0

I have a website with webrtc that works great between desktops. Now I'm trying comunicate between desktop and mobile, video is ok but the audio has lots of noise in mobile, I'm using the following constraints for desktop and mobile:

var constraints={audio:true,video:{"mandatory":{"minWidth":"320","minHeight":"240","maxWidth":"320","maxHeight":"240","maxFrameRate":"15","minFrameRate":"15"}}};

If I change the mobile audio constraint to:

audio:{echoCancellation:false}

Solves the noise problem, but now the desktop device hears the sound with echo. How can I solve this problem? The tests that I'm dooing are in chrome(desktop) and in mobile side Chrome for Android and in a hybrid app. The mobile device is a ZTE with android 6.0.1

Darm0ka
  • 192
  • 1
  • 14
  • Related [How can I prevent breakup/choppiness/glitches when using an AudioWorklet to stream captured audio?](https://stackoverflow.com/q/54794052/) – guest271314 Feb 24 '19 at 02:44

1 Answers1

0

Welcome to the world of webrtc, probably the browser is outdated and isn't supporting the echoCancellation flag (or is still buggy).

Update the browser might resolve the issue (if you can). Otherwise maybe try another mobile device and check if it works there, if that doesn't work I only know of the if(mobile) ... else ... solution until the browser is updated.

In worst case you even have to check for specific versions to disable the flag.

Obi-Wan
  • 846
  • 1
  • 11
  • 26
  • The problem continues, by browser is updated (Chrome 72), I don't understand what you mean with "In worst case you even have to check for specific versions to disable the flag"; at the moment I only want to set the audio input to headset earpiece in constraints with echoCancellation:false but when I change echo to false I can't set the constraints and audio goes to speakers. – Darm0ka Feb 26 '19 at 06:54
  • 1
    So this seems to be another issue you are having which isn't stated in the original question. My suggestion was to only enable the echoCancellation flag on non-mobile devices, so check from which plattform the user connects from and then define different contraints. Regarding you headset issue I'm not sure if this is connected to the echoCancellation flag, you are probably doing something wrong elsewhere. – Obi-Wan Feb 26 '19 at 15:58
  • Thanks for your attention, Im testing mobile to desktop, both with Chome, the only issue is in mobile that I cant set the constraint deviceId:headset with echoCancellation:false, the sound goes to speakers, if I set echoCancellation:true, the sound goes to headset but I only ear noise. I made tests with a lot of demos (PubNub,OpenTok ...) and none worked, Work with (Facebook and Hangouts but these are apps). I think that the problem is this specific phone (ZTE) based in this [link](https://bugs.chromium.org/p/chromium/issues/detail?id=617221#c1), I will try with a Samsung and report here. – Darm0ka Feb 26 '19 at 17:06
  • In fact, the problem is with the phone (ZTE), with the (Samsung) the test works fine. Problem solved, I will try a workarround with the (ZTE) – Darm0ka Feb 26 '19 at 19:13