Firefox createMediaStreamDestination error using rtc?

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) { /* 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 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

+6
source share
2 answers

Ok thanks @Ken Fyrstenberg I just tried building Firefox Nighly. In Nighly Everythink works fine (like in Chrome). Data types:

 stream //type: LocalMediaStream dest.steam //type: MediaStream 

as before, but I can hear the enemy and be able to mute the microphone.

Therefore, I can only wait for the exit: P

+3
source

To turn off the sound, you can enable / disable the track by following these steps:

 stream.getAudioTracks()[0].enabled = false; // mutes 

This will not solve the problem with the node gain, which is most likely a bug / limitation in Firefox at the moment (in which case we can only wait for the fix). But if the goal is to (un) mute the sound, this should work (it also works with video tracks).

+3
source

Source: https://habr.com/ru/post/984923/


All Articles