2

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.

1 Answers1

2

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.

Michael Tyson
  • 1,498
  • 1
  • 14
  • 23
  • Thank you Michael, so I'll wait for the referred audio framework. It will be free of charge or paid? Thank you for additional informations. – Ondřej Psylector Štěpán Nov 22 '12 at 11:19
  • No problem - it'll be free and open source – Michael Tyson Nov 22 '12 at 15:57
  • @MichaelTyson may i ask how to reinitialise an audio session ? i followed your sample code and got it work for the first time but i got a alert telling me could't initialise audio session!. did i missed out some steps ? – Desmond Aug 22 '13 at 03:03
  • Actually, you can't reinit an audio session, @Desmond; once it's initialised, that's it. You can change category and other settings, though. – Michael Tyson Aug 23 '13 at 05:26