Improve Audio Recording quality in android?

Nikunj Patel picture Nikunj Patel · Feb 22, 2012 · Viewed 8.2k times · Source

I am using the MediaRecorder for audio recording in android. I receive very poor audio quality when I record. I checked iPhone recording, and it is very good, but in android I receive horrible sound.

For sound recording I use:

 recorder = new MediaRecorder();
 recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
 recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
 recorder.setAudioEncoder(MediaRecorder.AudioSource.DEFAULT);
 recorder.setOutputFile(path);
 recorder.prepare();
 recorder.start(); 

How do I improve Audio Recording quality?

Answer

Praveenkumar picture Praveenkumar · Feb 22, 2012

Try this one -

recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setAudioEncoder(MediaRecorder.getAudioSourceMax());
recorder.setAudioEncodingBitRate(16);
recorder.setAudioSamplingRate(44100);
recorder.setOutputFile(path);
recorder.prepare();
recorder.start();