2011-12-29 11 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(); 
} 
関連する問題