const AudioContext = require('web-audio-api').AudioContext
, audioCtx = new AudioContext
, Speaker = require('speaker')
var constraints = {
audio: {
echoCancellation: true
}
};
var player = new Audio();
player.src= "samba.mp3"
audioSource = this.audioCtx.createMediaElementSource(player);
audioSource.connect(this.music_node);
this.music_node.connect(this.outputNode);
this.outputNode = this.audioCtx.createGain();
this.voice_node = this.audioCtx.createGain();
this.music_node = this.audioCtx.createGain();
this.voice_volume = 50
this.music_volume = 50
this.output = 100
var channels = 2;
audioCtx.outStream = new Speaker({
channels: channels,
bitDepth: 128,
sampleRate: 44100
})
speaker
var webcast = this.audioCtx.createWebcastSource(4096, 2);
this.outputNode.connect(webcast);
webcast.connect(this.audioCtx.destination);
webcast.connectSocket(encoder, this.url);
createWebcastSource
is from https://webcast.github.io/ right? So you're trying to stream FROM the browser TO some server?