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);
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.
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.
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).
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With