Hi,
you should do

String name = Environment.getExternalStorageDirectory().getAbsolutePath() +
"/Logger";

to get the right mount point for your sd card.

Hope this helps.

Nico

2011/8/4 Ab Caballero <[email protected]>

> 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

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