Intel INDE - How to control (mute) microphone input volume (input gain) in Android

一笑奈何 提交于 2019-12-11 03:32:35

问题


I'm using Intel INDE for video streaming purposes (Android) and it's giving me headaches to solve some problems.

The main problem is how to mute/unmute the devices microphone in Android.

Looks like Intel INDE is overriding the input volume to be always active. The only way I found is to not set the AudioFormatAndroid of Intel INDE API deleting these lines:

audioFormat = new AudioFormatAndroid("audio/mp4a-latm", 44100, 1);
capture.setTargetAudioFormat(audioFormat);

The problem is that I need to do it during the streaming, not before.

Therefore I tried to manage microphone input settings like:

AudioManager amanager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
amanager.setStreamMute(AudioManager.STREAM_NOTIFICATION, isMuteON);
amanager.setStreamMute(AudioManager.STREAM_ALARM, isMuteON);
amanager.setStreamMute(AudioManager.STREAM_MUSIC, isMuteON);
amanager.setStreamMute(AudioManager.STREAM_RING, isMuteON);

It did not work, so i tried to change Stream Volume, doing this:

amanager.setStreamVolume(AudioManager.STREAM_SYSTEM, 0, AudioManager.FLAG_SHOW_UI);

It shows a Toast stating that I muted the volume, but the audio stream is still active on my streaming.

I´ve searched StackOverflow and google about input gain (microphone volume) and found similar problems but none of them gave me a solution to my problem, can anyone help with this issue?

来源:https://stackoverflow.com/questions/28943540/intel-inde-how-to-control-mute-microphone-input-volume-input-gain-in-andro

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