Handling Interruptions While Recording in AAC is Difficult
Handling Interruptions While Recording in AAC is Difficult
- Subject: Handling Interruptions While Recording in AAC is Difficult
- From: Palmer Truelson <email@hidden>
- Date: Wed, 31 Oct 2012 12:22:56 -0700
Hi Folks,
I have what should be a simple problem... recording to low quality AAC audio on the iphone that works on both iOS 5.1 and 6.0. Making sure it does this robustly (i.e. handling interruptions) seems incredibly difficult.
Anyone know a working method that records 8 kHz low quality AAC audio recording on an iPhone and handles interruptions well on both iOS 5.1 and 6.0? I'm only asking after I've exhausted a number of attempts using AVAudioRecorder, AudioQueues, and RemoteIO.
Presently using RemoteIO, and if anyone has any experience setting up RemoteIO units that don't cause the media server to die on interruption on iOS 6, I would LOVE to hear from you.
---- Background and My Attempts ----
Basically, interruption causes the file to become corrupt, no matter what you do. I think this exists on iOS 6 as well.
So, I moved deeper into Core Audio and got an okay solution with AudioQueues. However, the latency is really pretty bad. I would have to wait 3.7 seconds usually after hitting the stop record button to flush the Audio Queue to ensure I got all the audio, and processing then took another 5-6 seconds. In order not to lock up the app, I had to put this in a separate thread, and if the app got backgrounded during that time, the processing would fail and the file would get corrupted.
So basically, 10 second processing latency + corruption on backgrounded processing meant AudioQueues were out for me.
So I went further down the rabbit hole and started using a RemoteIO one based on the Michael Tyson example (
http://atastypixel.com/blog/using-remoteio-audio-unit/) which works great on iOS 5.1 with no latency, but now I'm having serious problems handling interruptions on iOS 6.
However, the real problem is that audio interruptions on iOS 6 kill my mediaserverd process every time now when I'm using RemoteIO, rendering all my audio units and ExtAudioFile completely borked. I can reinitialized my audio units, but since the AudioFileConverter in my ExtAudioFile is borked as well, I'm left with a file I can't close down. Calling ExtAudioFileDispose just produces an error and a file that can't be read.
If anyone has any experience setting up RemoteIO units that don't cause the media server to die on interruption on iOS 6, I would LOVE to hear from you.
I'm still playing with workarounds, but I'm totally stumped on how to do what should be a simple task. I've tried as many methods as I could before bugging you all.
Has anybody gotten AAC audio recording on an iPhone in a robust manner? I would LOVE to see an example if there is one. The fact that the Apple's voice recorder works, means it has to be possible...
Thanks to anyone who can help!
Palmer
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden