问题
I am wondering if there is a way to tell the MediaRecorder to append to an existing audio file instead of starting it over from the beginning. In other words, I would like to call setOutputFile() with an existing file and have the new audio appended to that file instead of erasing it.
回答1:
Android MediaRecorder does not support appending.
Once you are recording the only possible actions are stop and reset.
So one option is saving as a WAV file, and then append to an existing WAV file saved on the SD card using AudioRecord instead. AudioRecord.read() allows one to save the raw audiodata to a buffer, which you could easily append to an existing recording.
来源:https://stackoverflow.com/questions/6247402/how-to-append-to-android-mediarecorder-output-file