Skip to content

Instantly share code, notes, and snippets.

@vunb
Last active July 14, 2016 10:06
Show Gist options
  • Save vunb/6704cca69bc0be76fad3 to your computer and use it in GitHub Desktop.
Save vunb/6704cca69bc0be76fad3 to your computer and use it in GitHub Desktop.
According to the thread pointed out by Gianni, to turn off echo cancellation, you'd want a media constraint that looked like:
{ audio: { optional: [{ your options }] } }
Looking at the easyrtc code, you should be able to do
easyrtc.enableAudio({ optional: [{ your options }]});
And expect that to be passed down to getUserMedia. It's not a documented use, but the enableAudio doesn't do a !! on the argument to force it to boolean (which it probably should have).
However, the thread mentions that as happening in version 37, while production version is 25. So I wouldn't expect it to work anywhere except in Canary.
var audioConstraints = {
mandatory : {
'googEchoCancellation':aec.checked,
'googNoiseSuppression' :ns.checked,
'googAutoGainControl' : agc.checked,
'googAutoGainControl2' : agc2.checked,
'googHighpassFilter' :hf.checked
},
optional : []
};
getUserMedia( {audio : audioConstraints, video :false} , onUserMediaSuccess, onUserMediaError);
Eric,
I did exactly the same yesterday- and came to the same conclusion. Apprtc is using OPUS codec, same as easyrtc but their audio is waaay better, especially on Android phones, where echo and noise make easyrtc practically unusable. But I noticed one more thing- their echo cancelation is not working in Firefox. So it must be that they are forcing some Chrome built-in echo cancelation with their SDP. I will experiment with SDP records and see if that will improve audio.
Thanks,
Zoran
@peerasan
Copy link

any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment