I'm building an audio recording app. For our users it's important that recordings never get lost - even if the app crashes, users would like to have the partial recording.
We encode recordings in AAC or ALAC and store them in an m4a file using AVAudioFile. However, in case the app crashes, those m4a files are invalid - the MOOV atom is missing.
Are there recording settings that change the m4a file so that it is always playable, even if the recording is interrupted half-way?
I'm not at all an expert in audio codecs, but from what I understand, it is possible to write the MOOV atom at the beginning of the audio file instead of the end. This could solve this. But of course, I'd prefer an actual expert to tell me what a good solution is, and how to configure this in AVAudioFile.