我知道如何按照以下代码录制语音
String path = android.os.Environment.getExternalStorageDirectory()+"/Record/test.3gp";
boolean exists = (new File(android.os.Environment.getExternalStorageDirectory()+"/Record/")).exists();
if(!exists)
{
newFile(android.os.Environment.getExternalStorageDirectory()+"/Record/").mkdirs();
}
MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(path);
try {
recorder.prepare();
recorder.start();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
在这段代码中,我在“recorder.setOutputFile(path);”中给出了输出路径 它工作正常,但我的问题是如果我再次录制它会覆盖相同的路径,所以请帮助我如何在 sdcard 的同一路径中保存多个声音请帮助我