Disabling Auto Gain Conctrol with WebRTC App
You can turn off audio processing using constraints (use https fiddle for Chrome):
var constraints = {
audio: {
echoCancellation: false,
noiseSuppression: false,
autoGainControl: false,
}
};
navigator.mediaDevices.getUserMedia(constraints)
.then(stream => audio.srcObject = stream)
.catch(e => log(e));
var log = msg => div.innerHTML += msg + "<br>";
<audio id="audio" controls autoplay></audio><br>
<div id="div"></div>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
Chrome apparently turns off all audio processing when echoCancellation: false
is specified.
Firefox doesn't do that yet, so include autoGainControl: false
and noiseSuppression: false
as well for now.
Both Chrome and Firefox (64+) appear to default autoGainControl
to true
.
Older versions of Firefox would default autoGainControl
to false
and noiseSuppression
to true
, but like all device settings, defaults may vary from browser to browser, device to device or even the situation, so if you care about a setting, constrain it.
All three settings can also be controlled individually in Chrome and Firefox.
There is now a google extension that can fix this.
https://chrome.google.com/webstore/detail/disable-automatic-gain-co/clpapnmmlmecieknddelobgikompchkk/related