I face a problem on audio encoder.I use MediaRecorder to record a voice. But, i find that my device must use default audioEncoder to record the voice successfully.
How can i check the type of default audio encoder??
Thanks.
Updated:
private MediaRecorder mRecorder = null;
public void startRecording(String aOutputFileName, int aOutputformat, int aAudioEncoder)
{
if(null == mRecorder){
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(aOutputformat);
mRecorder.setOutputFile(aOutputFileName);
mRecorder.setAudioEncoder(aAudioEncoder);
try {
mRecorder.prepare();
mRecorder.start();
}
catch (IOException e) {
e.printStackTrace();
Log.e(LOG_TAG, "prepare() failed");
}
}
}
Call Function:
mVoiceRecorder.startRecording(mFileName, MediaRecorder.OutputFormat.THREE_GPP, MediaRecorder.AudioEncoder.DEFAULT);