web-audio-workers-sockets
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "web-audio-workers-sockets", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "stream audio using web sockets in web worker rendered using web audio", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -254,3 +254,4 @@ var communication_sockets = function() { | ||
console.log("hit button create_websocket_connection"); | ||
// console.log("hit button create_websocket_connection"); | ||
console.error("ERROR - no web socket connection"); | ||
return; | ||
@@ -279,4 +280,19 @@ }; | ||
function socket_client(given_mode, given_binary_data, given_callback) { | ||
// function socket_client(given_mode, given_binary_data, given_callback) { | ||
function socket_client(given_msg) { | ||
// mode : 6, | ||
// callback : cb_receive_buffer_from_server_to_web_audio_player, | ||
// media_file : "2500_hz_sine_2_seconds.wav" | ||
var given_mode = given_msg.mode || 1; | ||
var given_binary_data = given_msg.binary_data || null; | ||
var given_callback = given_msg.callback || null; | ||
var given_media_file = given_msg.media_file || null; | ||
console.log("given_mode ", given_mode); | ||
console.log("given_binary_data ", given_binary_data); | ||
console.log("given_callback ", given_callback); | ||
console.log("given_media_file ", given_media_file); | ||
switch (given_mode) { | ||
@@ -345,3 +361,3 @@ | ||
console.log('... socket_client mode Five ... stream audio buffer from server '); | ||
console.log('... socket_client mode SIX ... stream audio buffer from server '); | ||
@@ -351,4 +367,8 @@ cb_for_client = given_callback; | ||
var requested_action = "stream_audio_to_client"; | ||
var requested_source = "Justice_Genesis_first_30_seconds_tight.wav"; // get buffer of this from svr | ||
// tell server to stream this audio | ||
// var requested_source = "Justice_Genesis_first_30_seconds_tight.wav"; | ||
// var requested_source = "2500_hz_sine.wav"; | ||
var requested_source = given_media_file; | ||
request_server_send_binary(requested_action, requested_source, given_callback); | ||
@@ -355,0 +375,0 @@ |
@@ -106,4 +106,6 @@ | ||
*/ | ||
} | ||
}; | ||
/* | ||
function forward_audio_buffer_to_player(audio_obj_from_server) { | ||
@@ -134,2 +136,3 @@ | ||
}; | ||
*/ | ||
@@ -228,3 +231,3 @@ // --- | ||
// --- | ||
/* | ||
function cb_stream_audio_buffer_to_web_audio_player(audio_obj_from_server) { // stream the right way | ||
@@ -309,3 +312,3 @@ | ||
}; // cb_stream_audio_buffer_to_web_audio_player | ||
*/ | ||
// --- | ||
@@ -374,5 +377,17 @@ | ||
communication_sockets.socket_client(5, null, cb_receive_buffer_from_server_to_web_audio_player); | ||
// var comm_msg = { | ||
// mode : 6, | ||
// callback : cb_receive_buffer_from_server_to_web_audio_player, | ||
// media_file : "2500_hz_sine_2_seconds.wav" | ||
// }; | ||
// communication_sockets.socket_client(5, null, cb_receive_buffer_from_server_to_web_audio_player); | ||
communication_sockets.socket_client({ | ||
mode : 6, | ||
callback : cb_receive_buffer_from_server_to_web_audio_player | ||
}); | ||
}; // cb_receive_buffer_from_server_to_web_audio_player | ||
@@ -827,2 +842,4 @@ | ||
/* | ||
@@ -1431,3 +1448,9 @@ | ||
var comm_msg = { | ||
mode : 6, | ||
callback : cb_receive_buffer_from_server_to_web_audio_player, | ||
media_file : "2500_hz_sine_2_seconds.wav" | ||
}; | ||
communication_sockets.set_stream_is_complete_cb(cb_stream_is_complete); | ||
@@ -1437,3 +1460,4 @@ | ||
// communication_sockets.socket_client(6, null, cb_stream_audio_buffer_to_web_audio_player); | ||
communication_sockets.socket_client(6, null, cb_receive_buffer_from_server_to_web_audio_player); | ||
// communication_sockets.socket_client(6, null, cb_receive_buffer_from_server_to_web_audio_player); | ||
communication_sockets.socket_client(comm_msg); | ||
@@ -1440,0 +1464,0 @@ break; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2984289
25
2458
4