I have been using the following code on all android devices for a while with no problem. I have since updated my Amazon code to match and their test have produced FAIL with the code.
After testing on emulator I am getting
01-08 22:04:33.322: E/AudioRecordTest(2857): prepare() failed 01-08 22:04:33.322: E/MediaRecorder(2857): start called in an invalid state: 4
code is
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setOutputFile(mFilePath + listOfAvailableFileNames.get(0));
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
try {
mRecorder.prepare();
} catch (IOException e) {
Log.e(LOG_TAG, "prepare() failed");
}
if (mRecorder != null) {
mRecorder.start();
}
Odd behavour