On Sun, May 10, 2009 at 4:45 PM, Jonas Alves <[email protected]> wrote:
> > Hi all... > I'm having really trouble there. > > When I attempt to play a sound file I have just recorded using > MediaRecorder, it fails when I call myMediaRecorder.prepare(). The > LogCat gives me: > > Prepare failed.: status=0xFFFFFFFC > > > That's what I'm doing: > > > String path = "/data/data/com.my.packages.name/cache/record.dat" > > // recording > MediaRecorder recorder = new MediaRecorder(); > recorder.setAudioSource(MediaRecorder.AudioSource.MIC); > recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); > recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); > recorder.setOutputFile(path); > recorder.prepare(); > recorder.start(); > recorder.stop(); > recorder.release(); > // finished recording > > // playing > MediaPlayer mediaPlayer = new MediaPlayer(); > mediaPlayer.setDataSource(path); > mediaPlayer.prepare(); // <- There it hangs You mean it prints the "prepare failed" message to the log, but never returns from the call to prepare()? Can you try setDataSource(FileDescriptor) instead? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

