Question

im making an application on android that requires to capture the user´s voice and recognize it. I tryed to record the audio using this code: http://xhampa.pastebin.com/Yr2hie6q on android 2.1. I realized that the sound wasn't recorded in a good quality at all (like slow motion). Unfortunally, I don't have an android to test it out, so I'm using the emulator. Is there anyway to improve record quality using the emulator?

Was it helpful?

Solution

The default recording quality when using mediarecorder is 4.75kbps and 8kHz, which is not adequate for any sort of audio processing. You simply need to change those values using the setAudioEncodingBitRate and setAudioSamplingRate methods.

setAudioSamplingRate(11.05)
setAudioEncodingBitRate(20)

The values that I included will optimize your audio quality, but you may need to change them to fit your needs.

Mediarecorder Documentation: http://developer.android.com/reference/android/media/MediaRecorder.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top