2011-12-29 136 views
1

任何人都可以請解釋如何將錄製的音頻文件存儲在單獨的文件夾中嗎?如何將錄製的音頻文件存儲在文件夾中

我使用默認的錄音機錄製音頻文件

Intent = new Intent (MediaStore.Audio.Media.RECORD_SOUND_ACTION); 
startActivityForResult(intent, 2); 

和我得到的絕對音頻路徑:

absolutepath audiopath is : /mnt/sdcard/recording1225555579.3gpp 

回答

0

可以通過指定自己的路試。

private void beginrec() throws IllegalStateException, IOException{ 
    ditchMediaRecorder(); 
    recorder=new MediaRecorder(); 
    recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 
    recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); 
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); 
    recorder.setOutputFile("/sdcard/voice/"); //like this 
    recorder.prepare(); 
    recorder.start(); 
} 
相關問題