Web audio API: microphone stream to reduce speaker volume?

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.

+4
source share
1 answer

, " ". , (, , ). Conctrol WebRTC; .

+3

Source: https://habr.com/ru/post/1667924/


All Articles