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.