1

Actually, I want to record the audio and allow the user to playback it(before saving) and after that prompt the user to give a particular name to the file for saving in to the memory(external storage).

Currently, I am able to record and playback the audio file(with the help of MediaRecorder and MediaPlayer), but unable to save it with some different name. So, I want to copy the content of recorded audio file to another file(empty) with user specified name.

Any help or guidance will be well appreciated.

4

1 回答 1

1

尝试这个

File dir = Environment.getExternalStorageDirectory();
if(dir.exist()){
    File from = new File(dir,"from.mp4");
    File to = new File(dir,"to.mp4");
     if(from.exist())
        from.renameTo(to);
}
于 2013-05-20T13:30:17.273 回答