You may do the following two points before the record. 1. set the permission for RECORD_AUDIO in Androidmanifest.xml. 2. simulate the sdcard.
The audio file should be stored in the sdcard. On Oct 9, 4:45 pm, Lurky <[EMAIL PROTECTED]> wrote: > Hi, All > I need record voice on the simulator and playback it. I wrot my > code according the example in the documents: > > A common case of using MediaRecorder to record audio works as > follows: > > MediaRecorder recorder = new MediaRecorder(); > recorder.setAudioSource(MediaRecorder.AudioSource.MIC); > recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); > recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); > recorder.setOutputFile(PATH_NAME); > recorder.prepare(); > recorder.start(); // Recording is now started > ... > recorder.stop(); > recorder.reset(); // You can reuse the object by going back to > setAudioSource() step > recorder.release(); // Now the object cannot be reused > > My code created the audio file, but there isn't any audio data in > it. > Would you give me a completed demo code for how to use > MediaRecorder ? > > Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---