I'm trying to provide an audio recorder within an application for the
user to dictate notes. I keep getting an error that there is no valid
output file and that the external storage is not available (I know it
is because i am using it in a separate activity). Any thoughts would
be appreciated.

private void recordAudio(){
                MediaRecorder recorder = new MediaRecorder();
                recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
                recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
                recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
                checkStorage();
                recorder.setOutputFile("/sdcard/Logger");
                try {
                        recorder.prepare();
                }
                catch (IllegalStateException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                recorder.start();   // Recording is now started
        }

-- 
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