I am using the Web audio API to stream my mic input into the speakers, so I can hear myself talk through them:
var aCtx = new AudioContext();
navigator.mediaDevices.getUserMedia({audio: true}).then(function (stream) {
var microphone = aCtx.createMediaStreamSource(stream);
microphone.connect(aCtx.destination);
})
It works fine, but whenever I keep a steady long voice input, it seems like the output gain drops after a couple of seconds.
I have followed cwilso's advice and added the echo cancellation constraint. But the results are still the same.
Here's a Fiddle: https://jsfiddle.net/hcrgL9eg/
Help would be appreciated.
Yeah, you're hitting "auto gain control". There are a bunch of features on audio input that are on by default (echo cancellation, AGC, noise reduction). Take a look at Disabling Auto Gain Conctrol with WebRTC App; it's the same solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With