How to record using AVAudioRecorder without a .caf container?

I am using an instance of AVAudioRecorder for recording with the setting for AVFormatIDKeyset to kAudioFormatMPEG4AAC. It records audio in AAC format, but the audio container .cafpacks the audio file. (I see the caff header in the recorder file). How to write so that the caff container is not there, but in pure m4a format so that I can use files on different platforms.

+5
source share
1 answer

Found the answer. There is a strange way AVAudioRecorder works.

The format in which AVAudioRecorder saves your file depends on the URL / line you specify for the file to be saved. It depends on the file name extension that you save.

- , , Core Audio. , , AVFormatIDKey . , aac .aac kAudioFormatMPEG4AAC AVFormatIDKey

+12

All Articles