Intel INDE - How to control (disable) the volume of the input microphone (input gain) in Android

I use Intel INDE for video streaming (Android) and it gives me headaches to solve some problems.

The main problem is how to mute / unmute the device’s microphone in Android.

Intel INDE seems to be redefining the input volume, which will always be active. The only way I found is not to install the AudioFormatAndroid from the Intel INDE API, removing these lines:

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

The problem is that I need to do this during streaming, not earlier.

So I tried to control the microphone input settings, for example:

 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); 

This did not work, so I tried changing the Stream Volume by doing the following:

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

It shows Toast, stating that I turned off the volume, but the audio stream is still active in my streaming.

I 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 problem?

+2
source share

Source: https://habr.com/ru/post/1264488/


All Articles