Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about "MODE_IN_COMMUNICATION" #8

Open
DengYu98 opened this issue Jul 3, 2022 · 1 comment
Open

Question about "MODE_IN_COMMUNICATION" #8

DengYu98 opened this issue Jul 3, 2022 · 1 comment

Comments

@DengYu98
Copy link

DengYu98 commented Jul 3, 2022

Hi @mail2chromium , there is a question:
If you set the MODE_IN_COMMUNICATION, you probably don't need the apm using webrtc.

AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);

I found out if i set MODE_IN_COMMUNICATION, the voice is pretty, i didn't listen any echo.
if i don't set MODE_IN_COMMUNICATION, only use the apm using webrtc, the voice is not that good.
what is the diff?? btw, what the webrtc version compiled in this project?
would you please kindly help to give me a reply soon? Thanks in advance!

@mail2chromium
Copy link
Owner

The difference is that MODE_IN_COMMUNICATION sets the audio mode for communication mode, which is optimized for voice calls. On the other hand, if you are only using the APM (Automatic Gain Control, Noise Suppression, Echo Cancellation, etc.) provided by WebRTC, the audio quality may not be as good as it would be in communication mode. Setting the audio mode to MODE_IN_COMMUNICATION enables the device to automatically apply the best audio processing settings for voice calls, which may result in better voice quality.


After reading the above statement, you may come up with some additional questions like If Hardware-based AEC, AGC, & NS are already working, then what is the use case of WebRTC APM?

WebRTC's APM (Automatic Gain Control, Noise Suppression, Echo Cancellation, etc.) can still be useful even when the audio mode is set to MODE_IN_COMMUNICATION.

WebRTC's APM provides a set of real-time audio processing algorithms that can be used to enhance the quality of voice and video calls. These algorithms can be used in conjunction with the audio processing algorithms and settings provided by the device's audio mode to further improve the quality of the call.

Example: Even though the MODE_IN_COMMUNICATION mode may provide some echo cancellation, noise suppression, and automatic gain control, the WebRTC's APM may provide additional, or different, implementations of these algorithms that can further improve the audio quality.

Therefore, using the APM provided by WebRTC in addition to setting the audio mode to MODE_IN_COMMUNICATION can help to further enhance the overall quality of voice and video calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants