Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

websockets-streaming-audio

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websockets-streaming-audio - npm Package Compare versions

Comparing version 1.0.5 to 1.0.8

src/bad_A.log

2

package.json

@@ -36,3 +36,3 @@ {

"subdomain": "websockets-streaming-audio",
"version": "1.0.5"
"version": "1.0.8"
}

@@ -6,3 +6,2 @@

// var ww_handle = new Worker("ww_transferable_obj.js");
var ww_handle = new Worker("ww_transferable_obj.js");

@@ -53,4 +52,2 @@

console.log("TOP browser_queue_filled");
// do transition from state (1) OR (3) --> (2)

@@ -68,28 +65,2 @@

var msg_curr_mode = msgs_to_server_by_mode[mode_ww_get_audio_from_server];
if (typeof msg_curr_mode !== "undefined") {
// OK
} else {
msg_curr_mode = msgs_to_server_by_mode[mode_browser_get_audio_from_server];
if (typeof msg_curr_mode !== "undefined") {
msg_curr_mode.browser_directed_mode = mode_ww_get_audio_from_server;
msgs_to_server_by_mode[mode_ww_get_audio_from_server] = msg_curr_mode;
} else {
throw new Error("ERROR - we assumed initial state was populated");
}
}
shared_utils.show_object(msg_curr_mode, "ggggg#####ggggg msg_curr_mode", "total", 10);
// ------------
current_browser_mode = mode_ww_get_audio_from_server; // (1) OR (3) --> (2)

@@ -99,8 +70,3 @@

// ww_handle.postMessage(JSON.stringify({
// browser_directed_mode : current_browser_mode
// }));
ww_handle.postMessage(
JSON.stringify(manage_state.get_msg_to_server_by_mode(manage_state.get_state())));
ww_handle.postMessage(JSON.stringify(msgs_to_server_by_mode[mode_ww_get_audio_from_server]));
}

@@ -122,30 +88,2 @@

var msg_curr_mode = msgs_to_server_by_mode[mode_browser_get_audio_from_ww];
if (typeof msg_curr_mode !== "undefined") {
// OK
} else {
msg_curr_mode = msgs_to_server_by_mode[mode_browser_get_audio_from_server];
if (typeof msg_curr_mode !== "undefined") {
msg_curr_mode.browser_directed_mode = mode_browser_get_audio_from_ww;
msgs_to_server_by_mode[mode_browser_get_audio_from_ww] = msg_curr_mode;
} else {
throw new Error("ERROR - we assumed initial state was populated");
}
}
shared_utils.show_object(msg_curr_mode, "yyyyyy^^^^^^^yyyyyyy msg_curr_mode", "total", 10);
// ---------
current_browser_mode = mode_browser_get_audio_from_ww;

@@ -155,8 +93,5 @@

// ww_handle.postMessage(JSON.stringify({
// browser_directed_mode : current_browser_mode
// }));
// shared_utils.show_object(msg_curr_mode_3, "msg_curr_mode_3", "total", 10);
ww_handle.postMessage(
JSON.stringify(manage_state.get_msg_to_server_by_mode(manage_state.get_state())));
ww_handle.postMessage(JSON.stringify(msgs_to_server_by_mode[mode_browser_get_audio_from_ww]));
}

@@ -174,18 +109,30 @@ },

var returned_msg = manage_state.get_msg_to_server_by_mode(manage_state.get_state());
// ww_handle.postMessage(JSON.stringify({
// browser_directed_mode : current_browser_mode
// }));
ww_handle.postMessage(JSON.stringify(returned_msg));
}
},
set_msg_to_server_by_mode : function(given_mode, given_msg) {
// setup msgs to server for all 3 modes
ww_handle.postMessage(JSON.stringify(returned_msg));
msgs_to_server_by_mode[mode_browser_get_audio_from_server] = given_msg;
msgs_to_server_by_mode[mode_ww_get_audio_from_server] = {};
msgs_to_server_by_mode[mode_browser_get_audio_from_ww] = {};
var arr_other_modes = [];
arr_other_modes.push(mode_ww_get_audio_from_server);
arr_other_modes.push(mode_browser_get_audio_from_ww);
for (var curr_mode in arr_other_modes) {
for (var curr_property in given_msg) {
msgs_to_server_by_mode[arr_other_modes[curr_mode]][curr_property] = given_msg[curr_property];
}
}
},
set_msg_to_server_by_mode : function(given_mode, given_msg) {
msgs_to_server_by_mode[given_mode] = given_msg;
msgs_to_server_by_mode[mode_ww_get_audio_from_server].browser_directed_mode = mode_ww_get_audio_from_server;
msgs_to_server_by_mode[mode_browser_get_audio_from_ww].browser_directed_mode = mode_browser_get_audio_from_ww;
},

@@ -214,7 +161,8 @@ get_msg_to_server_by_mode : function(given_mode) {

var count_requests = 0;
var max_requests = 999999; // limit only to ease troubleshooting
// var max_requests = 999999; // limit only to ease troubleshooting
var max_requests = 0; // limit only to ease troubleshooting ... set to 0 to ignore
return function(given_source) {
if (count_requests < max_requests) {
if (max_requests === 0 || count_requests < max_requests) {

@@ -232,3 +180,3 @@ // if (manage_state.is_early_days()) { //

console.log("sorry its NOT early days or Middleburg ...");
console.log("its NOT early days or Middleburg ...");
}

@@ -406,6 +354,6 @@

// var array_min_thr_N_size = { browser_queue_max_size : 4, browser_queue_min_threshold : 2 };// quickest start
// var array_min_thr_N_size = { browser_queue_max_size : 6, browser_queue_min_threshold : 3 };
var array_min_thr_N_size = { browser_queue_max_size : 10, browser_queue_min_threshold : 2 };
// var array_min_thr_N_size = { browser_queue_max_size : 6, browser_queue_min_threshold : 2 };
// var array_min_thr_N_size = { browser_queue_max_size : 10, browser_queue_min_threshold : 2 };// good one
// var array_min_thr_N_size = { browser_queue_max_size : 12, browser_queue_min_threshold : 3 };
// var array_min_thr_N_size = { browser_queue_max_size : 18, browser_queue_min_threshold : 6 };// good
var array_min_thr_N_size = { browser_queue_max_size : 18, browser_queue_min_threshold : 2 };// good
// var array_min_thr_N_size = { browser_queue_max_size : 24, browser_queue_min_threshold : 6 };

@@ -424,5 +372,5 @@ // var array_min_thr_N_size = { browser_queue_max_size : 28, browser_queue_min_threshold : 8 };// slow start

stream_audio_msg.browser_queue_max_size = browser_queue_max_size;
// stream_audio_msg.ww_queue_max_size = browser_queue_max_size * 2; // integer multiple >= 2
stream_audio_msg.ww_queue_max_size = browser_queue_max_size * 2; // integer multiple >= 2
// stream_audio_msg.ww_queue_max_size = browser_queue_max_size * 4; // integer multiple >= 2
stream_audio_msg.ww_queue_max_size = browser_queue_max_size * 6; // integer multiple >= 2
// stream_audio_msg.ww_queue_max_size = browser_queue_max_size * 6; // integer multiple >= 2 # good one
// stream_audio_msg.ww_queue_max_size = browser_queue_max_size * 8; // integer multiple >= 2

@@ -553,7 +501,7 @@

// all_media[12] = "Die_Antwoord_11_doong_doong_30_sec.wav";
all_media[13] = "Justice_Genesis_first_30_seconds_tight.wav";
all_media[13] = "SHAKUHACHI_Masayuki_Koga_trim_mono-IMi00aV1tdA.wav";
// all_media[14] = "Glenn_Gould_Partita_No_5_BWV_829_Praeambulum_mono-0YvnW_lMNTM.wav";
// all_media[15] = "Contrabass_Saxophone_mono_hXBeu7o9uUM.wav";
all_media[16] = "SHAKUHACHI_Masayuki_Koga_trim_mono-IMi00aV1tdA.wav";
// all_media[17] = "Justice_Genesis_mono-y6iHYTjEyKU.wav";
all_media[16] = "Justice_Genesis_first_30_seconds_tight.wav";
all_media[17] = "Justice_Genesis_mono-y6iHYTjEyKU.wav";
// all_media[17] = "Chopin_Fantasie_Impromptu_opus_66_mono_clip_APQ2RKECMW8.wav";

@@ -646,16 +594,2 @@

console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
console.log("deal with prior run .... curr_msg_stop");
}

@@ -679,17 +613,4 @@

console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("just POPulated requested_source");
console.log("\n\n launch_stream_audio \n\n");

@@ -696,0 +617,0 @@ console.log(curr_msg_stream);

@@ -258,4 +258,2 @@

// var socket_client = function(given_msg) {
var socket_client = (function() {

@@ -269,9 +267,4 @@

shared_utils.show_object(given_msg, "CCCCCCCCCCC given_msg ", "total", 3);
var given_mode = given_msg.mode;

@@ -278,0 +271,0 @@

@@ -119,2 +119,4 @@

console.log("cb_receive_buffer_from_server " + curr_mode);
switch (curr_mode) {

@@ -344,3 +346,3 @@

switch (received_json.browser_directed_mode) {
switch (received_json.browser_directed_mode) { // mode 3

@@ -358,3 +360,3 @@ case "browser_get_audio_from_ww" : {

case "ww_get_audio_from_server" : {
case "ww_get_audio_from_server" : { // mode 2

@@ -372,4 +374,7 @@ // stens TODO - flip callback which retrieves data from server

ww_client_socket.socket_client(received_json);
ww_client_socket.socket_client(received_json);
} else {
console.log("booo hoo is_production_possible says NNNOOOOOOOOOOO");
}

@@ -380,3 +385,3 @@

case "browser_get_audio_from_server" : {
case "browser_get_audio_from_server" : { // mode 1

@@ -383,0 +388,0 @@ console.log("bsbs bsbsbsbs bsbsbsbs bsbs browser_get_audio_from_server");

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc