Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to adjust microphone volume in android?

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);
like image 440
user1206329 Avatar asked Aug 29 '12 10:08

user1206329


People also ask

How do I change my Microphone settings on my Android?

To change the microphone settings on Android, go to Settings > Apps > Permissions > Microphone. You'll see the apps that have permissions to change the microphone settings. Allow or deny microphone access for apps as needed.

How do I adjust my Microphone volume?

Make sure your headset or microphone is plugged in, then right-click the speaker icon in the lower- right corner of the Windows taskbar. Click Recording Devices. Speak into the microphone at the same volume and distance you will use when recording. While you are speaking, watch the Input Level for the microphone.

How do I lower my Microphone volume on Android?

Go to Settings > System > Sound. Under Input, make sure your mic is selected, then click Device Properties. Select Additional device properties. In the Levels tab, increase or decrease the Microphone (sensitivity).


1 Answers

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);
like image 51
Ion Aalbers Avatar answered Oct 03 '22 14:10

Ion Aalbers