How to avoid echo and noise in javascript for webrtc

Zhenguo Yang picture Zhenguo Yang · Aug 23, 2013 · Viewed 14.6k times · Source

I am trying to implement a webrtc-based chat room. And I encountered the following problems in laptop. Without connecting to any other peer, just use getUserMedia(), I can get local video stream.

When I unmuted the , echo happened.

Then I wear headphone, and found there is a continue noise. And I can hear my voice clearly.

I tried to turn down the volumn, but it doesn't work.

Thanks in advance.

Answer

tomtheengineer picture tomtheengineer · Aug 23, 2013

Make sure that you are muting the local <video> element if you have it in the DOM:

<video id="vid1" autoplay="true" muted="muted"></video>

See this post on the discuss-webrtc mailing list for more details and the WebRTC samples.