Android : How to save an audio file in mp3 format.Why android does not have this basic support?

on Friday, July 4, 2014


How to save an audio file in mp3 format.Why android does not have this basic support?


To save as 3GP:



mFileName = Environment.getExternalStorageDirectory().getAbsolutePath();
mFileName += "/audiorecordtest.3gp";

private void startRecording() {
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setOutputFile(mFileName);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

try {
mRecorder.prepare();
} catch (IOException e) {
Log.e(LOG_TAG, "prepare() failed");
}

mRecorder.start();
}



  1. I tried to convert 3gp file to MP3 using Lame,but If want to use Lame,I need NDK.I am trying to convert without using NDK(reference).Is it any possible to way to do this?

  2. Why MediaRecorder.OutputFormat class does not have basic mp3 support in Android?


0 comments:

Post a Comment