WebRTC Acoustic Echo cancelation
Asked Answered
I

3

6

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

Indogermanic answered 23/5, 2016 at 12:5 Comment(2)
WebRTC is a P2P data transfer protocol and has nothing in common with audio.Happen
@Happen you're thinking of RTCPeerConnection. For historical reasons, WebRTC is often used as an umbrella term for both that and the getUserMedia API. Even peer connections aren't data-agnostic, and deal specifically with audio and video.Folse
I
1

Currently there's no best solution for echo cancelation in webrtc, so the best solution i found is using AEC software, or built in echo cancelation software

Indogermanic answered 10/6, 2016 at 5:2 Comment(0)
F
7

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.

Folse answered 23/5, 2016 at 14:26 Comment(4)
yes i have no problem if i use a headset, but the echo still exist if i didn't use it because my voice returned from other people speaker and that cause echo or feedback, have any other solution for this ?.Indogermanic
@ShinjiKagehisa what browser, system and microphone?Folse
chrome, firefox using osx, windows, linux and builtin microphoneIndogermanic
@ShinjiKagehisa actually, if you're hearing your voice returned from other people's speakers then maybe the echo is on their system. I would try different participants to isolate where the echo is coming from (I know you mentioned headphones fixing it which is what's confusing).Folse
I
1

Currently there's no best solution for echo cancelation in webrtc, so the best solution i found is using AEC software, or built in echo cancelation software

Indogermanic answered 10/6, 2016 at 5:2 Comment(0)
K
1

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.

Kelsiekelso answered 9/5, 2020 at 17:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.