Hi,

I have the following ridiculously simple code which for some reason is
not working:

recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(audioFile.getAbsolutePath());
recorder.prepare();
recorder.start();

It fails with a runtime exception at recorder.start() with the message
"start failed". Very informative. I have verified that the audioFile
points to something reasonable (/data/data/com.dermvision.vfuAndroid/
files/audio.m4a) and that this file gets created, though with 0
length. I have used basically the same code in the past without
problems. I have tried running on 2.2 and 3.2 emulators with the same
result. The computer running the emulator has working audio hardware.
I have not yet tried running on an Android device. The application has
RECORD_AUDIO permissions.

Any ideas would be greatly appreciated -- this is really getting
annoying.

Thank very much,

Matthew Fleming
DermVision

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to