Increase Android AudioRecord Recording Capacity

I use AudioRecord and lame to record mic input into mp3 sample within 12 seconds. The sound is a recorder as expected, but I realized that the volume is too low.

Is there a way to increase the recording volume?

+10
android android-audiorecord android-audiomanager
source share
2 answers

There audioRecord no gain settings in the audioRecord class, so you cannot control the volume of the recorded sound. Low sound volume is associated with equipment and varies from device to device. Here are some options you can try.

1) try opening the audio recording in different modes and see what works best. check - http://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html

2) in the audio recording, you get raw PCM buffers. You can write a simple code / function to shift the bits (8/16 bits per channel) left or right to double or halve the gain. (Think of it as a very crude volume control)

3) try searching the web for more sophisticated digital gain methods for smoother control. There are many implementations. (There are also own methods)

Check: How to adjust microphone sensitivity while recording audio in android

+5
source share

You can also simply increase the volume of the device:

 AudioManager am = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE); int previousVolume = am.getStreamVolume(AudioManager.STREAM_MUSIC); am.setStreamVolume(AudioManager.STREAM_MUSIC, 10, 0); {... do your things ... } am.setStreamVolume(AudioManager.STREAM_MUSIC, previousVolume, 0); 

In my case, it was easy to fix, and it worked with the rest of the application.

0
source share

All Articles