简体   繁体   中英

WebRTC Acoustic Echo cancelation

我目前正在从事 webrtc 项目,并且在不使用耳机或外部麦克风时遇到音频回声问题,是否有任何解决方法或解决方法

Echo cancellation is supposed to be on by default in WebRTC. You can turn it off to hear the difference:

 navigator.mediaDevices.getUserMedia({ audio: { echoCancellation: false } }) .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>

Echo cancellation technology can exist at many levels - software in the browser, in the OS, and sometimes even in your hardware mic - sometimes these technologies can interfere with each other.

Not knowing your system, I would recommend checking out your system's sounds settings to make sure you don't have helpful processing happening at too many levels.

For example, on OSX, there's a use ambient noise reduction feature under Sound Settings that unintuitively works better for me with WebRTC when I turn off . You only want one chef attempting echo cancellation at the same time.

If you are working on a web site for other clients, then there's not much you can do in software, and I would expect most systems to work, if not perfectly, decently well, though a headset will always be better.

目前在 webrtc 中没有最好的回声消除解决方案,所以我发现最好的解决方案是使用 AEC 软件,或内置回声消除软件

I had the same trouble even with the video echoCancellation constraint

I could finally delete the echo/noise adding the property muted="true" to your local video element and set up the volume to 0 document.getElementById("localVideo").volume = 0

That will not prevent your localStream to have the sound but it'll cancel the noise you have locally.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM