I stream audio over rtc and want to mute and unmute the audio.
This works... but no gain control:
function(stream) { /* getUserMedia stream */
console.log("Access granted to audio/video");
peer_connection.addStream(stream);
}
This works on chrome but NOT on Firefox (with gain control)
function(stream) { /* getUserMedia stream */
console.log("Access granted to audio/video");
var microphone = context.createMediaStreamSource(stream);
gainNode = context.createGain();
var dest = context.createMediaStreamDestination();
microphone.connect(gainNode);
gainNode.connect(dest);
local_media_stream = dest.stream;
peer_connection.addStream(local_media_stream);
}
I get no error and i hear no voice. When I send the gainNode to context.destination i can hear myself.
I think "context.createMediaStreamSource(stream)" is broken in any way. Can anyone tell me why ? and how to fix this.
EDIT: So i checked the streams and:
stream //type: LocalMediaStream
dest.steam //type: MediaStream
in Firefox! In chrome both are MediaStreams