I transmit audio via rtc and want to turn off the sound and turn on the sound.
This works ... but without gain control:
function(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) { 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 have no mistakes and I donβt hear a voice. When I send gainNode to context.destination, I hear myself.
I think that "context.createMediaStreamSource (stream)" is broken in some way. Can someone tell me why? and how to fix it.
EDIT: So, I checked the threads and:
stream //type: LocalMediaStream dest.steam //type: MediaStream
in Firefox! Chrome also has MediaStreams
source share