So, I have an audio recording iOS app I am working on. In my app I have the need to write audio at any point in the file (in the documents directory) the user chooses, which will overwrite whatever audio is there.
Example: I record 3 min of audio, scroll back to minute two, start recording again for 10 seconds. Now, 2:00 - 2:10 contains the new audio, and the old audio is gone (the audio file does not get longer in this example).
I am using EZAudio and I can record and pause as many times as I want and it will keep appending to the end. I was going to use ExtAudioFileSeek
to seek backward in the file and record from there, but you can only use that when the file is open as read-only.
What I don't want: I don't want to record to a different file, and append the two files together using this method: https://stackoverflow.com/a/10562809/1391672 There is significant loading time associated with this. The iOS app Voice Memos appends files together instantaneously.
Can ExtAudioFileWriteAsync
be used to append audio at the beginning? Or at a specified sample location? Is there another method I should look at?