How to increase the microphone gain while recording? - android

I'm building video chat application. During the call only one side audio is clear and other side its feeble and quiet. I want to increase the gain of microphone on the device so that the voice is clearly audible at other side.
Can any one tell me how to increase the Microphone gain programatically in android?
More specifically which API should I use for this?

When the microphone is open, it used the volume of the AudioManager.STREAM_MUSIC.
Try to increase this volume and check if the microphone volume also increased.

Related

How to set type to my audio so it will be treated like a call?

I'm making VoIP app on Android, playing PCM audio like in Play PCM stream in Android
On my phone (LG V20, Android8) it works, but when I'm using volume buttons, it doesn't show Call volume and volume control doesn't work for my audio at all.
How to make my audio "Call audio" and be controlled by standard volume controls?
You have to take AudioFocus by calling "requestAudioFocus()": https://developer.android.com/reference/android/media/AudioManager#requestAudioFocus(android.media.AudioFocusRequest) and set VOICECALL Stream in the Constructor of the Request.
In the end, I was missing:
Permission - MODIFY_AUDIO_SETTINGS
Setting AudioManager mode to MODE_IN_COMMUNICATION
I'm surprised it wasn't in tutorials, maybe it was changed in later SDK.

How to adjust microphone volume in Android programmatically

Is there a way to increase/decrease the input volume of the Android microphone. I did some research on Google as well as StackOverflow but didn't find a suitable answer.
Here are some links:
How to adjust microphone volume in android?
Adjust Microphone Recording Volume
Is Android capable of managing microphone/input volume?.
Please provide any help/reference.
I had a certain problem where I had to increase the volume (gain) of the sound and also filter out some frequencies I used TarsosDSP library for android it has a particular class called GainProcessor where you can adjust the sound accordingly. Hope it helps.

Hardware limitations with iPhone Microphone

I'm using EZAudio FFT to analyze audio as the iPhone "hears" it. I am listening for high-pitched sounds embedded into music (17 kHz+). When the iPhone hears the sounds with no music, it records the data perfectly and hears the pitch fine. However, when music is playing the sounds are no longer heard--or only 1 in about 8 are heard. Again, I am using EZAudio, to analyze the sound. I have an Android phone that has a similar app on it (displays an graph of Hz for incoming audio waves), but the Android phone can hear these sounds.
Why would the Android phone hear these high-pitched sounds but not the iPhone? Is it because of a flaw in EZAudio or is it due to a higher quality microphone?
The answer is most likely answer is Automatic Gain Control (AGC). This is enabled by default on the microphone, and is useful for telephony or voice recording.
At 17kHz, you're probably already at a frequency at which the microphone is not particularly sensitive, however, in the absence of audio at other frequencies, the AGC will have increase the gain of the microphone. As soon as other frequencies are present, the gain reduces again, and the 17kHz signal is in the noise.
Looking at the EZAudioFFT source code, it doesn't appear to be setting up the AVAUdioSession to use measurement-mode (which disables AGC, and the HPF on the microphone).
You can achieve this with:
NSError *pError = nil;
[[AVAudioSession sharedInstance] setMode:AVAudioSessionModeMeasurement];

how to capture data going for soundcard

I want to capture soundcard data.Means whatever playing on phone.It may be alert sounds,sound from sound etc,whatever sound is coming from device.I want to capture sound with android framework classes only.I dont want any native programming.Is it possible?If other tools are available plz provide me details.
If the device is in speakerphone mode, you can record via the microphone and it will pick up whatever the device is playing, along with any other ambient sounds. Use AudioRecord or MediaRecorder as you see fit.
If the device is not in speakerphone mode, you have no means of intercepting the audio output of other applications.

Getting microphone volume while recording

I'm using the simple app shown in the Android documentation to play around with recording and playing audio. Just to add a small feature, I want to get the volume of the microphone while it's recording to move a bar like how the voice recognition will fill the microphone while you are speaking into it. I looked around online, but no one seems to have a definitive answer, could someone point me in the right direction? Thanks!
i think there is no specific volume for mic. when you are recording that takes media volume as mic volume.

Categories

Resources