I use the web audio API to stream microphone input into speakers, so I can hear me talking 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 great, but whenever I keep a steady long voice input, it seems that the output gain drops after a couple of seconds.
I followed cwilso's advice and added an echo cancellation restriction. But the results are the same.
Here's the script: https://jsfiddle.net/hcrgL9eg/
Help will be appreciated.
source
share