How to avoid echo and noise in javascript for webrtc

孤街浪徒 提交于 2019-11-28 22:49:49

问题


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.


回答1:


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.




回答2:


Do the followings:

1) In localVideo do the this:

localVideo.volume = 0;

localVideo.muted = 0;

2) Do same for the remoteVideo also:

remoteVideo.volume = 0;

remoteVideo.muted = 0;




回答3:


To resolve noise related issue, you should set autoplay=false for localstream.



来源:https://stackoverflow.com/questions/18406193/how-to-avoid-echo-and-noise-in-javascript-for-webrtc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!