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

web-audio-workers-sockets

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web-audio-workers-sockets - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

media/2500_hz_sine_2_seconds.wav

2

package.json
{
"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

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