Question

I work on iOS app with recording feature. I have big problem with straight AAC mpeg4-audio recording in .m4a file.

My working solution is recording in .caf and then converting this file in required .m4a format, but is it slow and not acceptable.

I found the Michael Tyson's wrapper TPAACAudioConverter, which is maybe the right solution, but my problem is, that i don't know how to correct initialize and use this wrapper for direct AAC recording in .m4a file (without the supplementary post-conversion after recording).

If anyone have the working example on Github or can me help with it, please let me know.

Many thanks.

Was it helpful?

Solution

TPAACAudioConverter's not well suited for live recording, just because of the way it's structured, pulling audio from a delegate instead of offering the ability to send audio to it directly.

I recommend using the ExtAudioFile services directly, as it already does the work for you.

If you really have to use TPAACAudioConverter, you'll need to use a ring buffer (like TPCircularBuffer) to store audio until TPAACAudioConverter retrieves it via the delegate method. It's messy though; use ExtAudioFile.

For the record, The Amazing Audio Engine contains a very simple mechanism for recording straight to AAC, or any other supported format. It'll be out soon.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top