Acoustic Echo Cancellation

Hi I have an video/auido call app and the call is happening on speaker mode so this is causing an echo loop on devices as much as I find info about this by default it should be open but I am still havig this problem idk how to check if its enabled I dont see any log represents those settings are enabled or disabled i have set {echoCancellation:true } constraints to audio device but still having a crazy echo on devices (devices are xiaomi mi 8 lite android 9 and samsung c5 android 6 ).
I am just having this logs related to audioeffectclass;

  2020-03-13 15:53:15.123 5493-5544/com.app/org.webrtc.Logging: WebRtcAudioEffectsExternal: ctor@[name=pool-5-thread-1, id=286]

2020-03-13 15:53:15.142 5493-5544/com.app/org.webrtc.Logging: WebRtcAudioEffectsExternal: ctor@[name=pool-5-thread-1, id=286]

2020-03-13 15:53:44.808 5493-5550/com.app/org.webrtc.Logging: WebRtcAudioEffectsExternal: enable(audioSession=249)

I have solved the problem by setting audio mode to in communication

AudioManager am = (AudioManager)mContext.getSystemService(mContext.AUDIO_SERVICE);
am.setMode(AudioManager.MODE_IN_COMMUNICATION);

@saghul Should this be the default mode?

Not really. Audio device management is left to the application because there are too many things to consider.

You can use the in call manager project to set that up for example: https://github.com/react-native-webrtc/react-native-incall-manager