video-streamingwebrtcgetusermedia

getUserMedia how can i improve audio quality? How can I make audio to stop echoing?


I been trying to work with webRTC for a few day. One of the problem that I faced since then is the audio quality. The audio from getUserMedia is horrible. It is echoing a lot. I have try all the constraint but still echoing. This is my code.

navigator.mediaDevices.getUserMedia({ video: { width: 300, height: 300, frameRate: 30 }, audio: { volume: 0.3, sampleSize: 16, sampleRate: 44100, echoCancellation: true, noiseSuppression: true }, })

I know that there is a way to make the audio quality better because a website like omegle use the same technology but they have very clear audio. So please if someone is kind enough to point me to the right direction to get the better audio, I really appreciate it.


Solution

  • The reason for the audio keep echoing is because both input audio and output audio came from the same device. If the local video is muted and only turn on the incoming audio, the echo disappeared. I hope this will help if anyone experience the same problem as mine.