Search code examples
webrtcweb-audio-api

What webrtc media constraints should I use to remove all processing / effects on the audio?


I am currently using

  var mediaOptions = { 
        audio: {
          optional: {
            sourceId: this.get('audioInputId'),
            googAutoGainControl: false,
            googNoiseSuppression: false,
            googEchoCancellation: false,
            googHighpassFilter: false
          }
        }
    }

Is there anything else I should be turning off? I'm recording the audio so it needs to be untouched by any processing.

I'm noticing that sometimes there is a ducking effect on one end when others are talking.

Also, are there any flags for Firefox? Does Firefox respect any of these?


Solution

  • On Firefox you should be fine only with

        audio : {
            "mandatory": {
                "echoCancellation": "false"
            }
        }
    

    and in Chrome

            audio : {
                "mandatory": {
                    "googEchoCancellation": "false",
                    "googNoiseSuppression": "false",
                    "googHighpassFilter": "false",
                    "googTypingNoiseDetection": "false"
                },
                "optional": []
            }
    

    But disabling these features it's usually done if you want to stream music. If you stream voice I think it's recommended to leave them on.

    The ducking effect on voice streaming is not because of any processing, rather of a slow network (low bandwidth or high latency).