WebRTC Acoustic Echo cancelation

后端 未结 3 677
一生所求
一生所求 2021-01-18 19:39

I\'m currently working on webrtc project, and having a problem with audio echo when not using an earphone, or external mic, is there any work around or fix for this

3条回答
  •  遥遥无期
    2021-01-18 20:28

    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 + "
    ";

    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.

提交回复
热议问题