views:

35

answers:

1

Hi, 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 wasnt recorded in a good quality at all (like slow motion). Unfortunally, I dont have an android to test it out, so im using the emulator. Is there anyway to improve record quality using the emulator?

Thank you for your time and sorry for my bad english.

A: 

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

Andrew