I am using MediaRecorder in my Android app. I referred to the online documentation for the public void setOutputFile (String path) of the MediaRecorder class but couldn’t find information as to whether it overwrites an existing file at the same path or appends to the existing file, if it exists.
So, two questions:
- Does
public void setOutputFile (String path)overwrite the file atpath, if it exists, or it appends to the file atpath? - Is there any way to resume an already paused recording which is saved at a particular path?
Thanks in advance.
So far from my finding, I conclude that the Android API currently does not provide an option to resume recording using
MediaRecorder.So manage my target of merging two recorded audio, I went with direct merging of two files by skipping the headers from the second file.
Following is my code for reference:
And my code for combining the two audio files is as follows:
In short what I am doing is – skipping the headers of the second file (The length of the header in AMR file is 6 bytes).
This worked for me and I tested it on Android version 2.3
Hope this helps others!