6
votes

I want to recorder the sound, but the mic (microphone) input sound is too loud, and I want to adjust the mic volume, would someone help me? The following is the main code:

private int audioSource = MediaRecorder.AudioSource.MIC;

private static int sampleRateInHz = 8000;

private static int channelConfig = AudioFormat.CHANNEL_CONFIGURATION_MONO;

private static int audioFormat = AudioFormat.ENCODING_PCM_16BIT;

audioRecord = new AudioRecord(audioSource, sampleRateInHz,channelConfig, audioFormat, bufferSizeInBytes);
audioManager.setSpeakerphoneOn(false);
1
did you found any ways to adjust the microphone sensitivity?Raneez Ahmed
In my scenario, the speaker volume is correct, but mic volume is very low. Even i tried audiomanager class to increase the volume,but it remains same low volume. please give me a solution. thanks in advance.Nandhakumar Kittusamy

1 Answers

2
votes

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.

With:

AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
am.setStreamVolume(AudioManager.STREAM_MUSIC, yourVolume, 0);