In my iOS application in all previous versions of the OS, we sometimes record audio, then sleep for a while, then record again and continue cyclically (sleep should support the battery). This worked great with iOS 7, even when the app was in the background. Now that the application is in the background, the call to AudioQueueStart cannot start recording with the error: -16981. I can’t find this error code in the documentation or on the Internet, and if I turn it into an NSError, he says: "The operation could not be completed (OSStatus error -16981.)", That not all of this is useful.
I have a theory that Apple closes the hole here; the idea was; why do you want to start recording from the background process if you are not spying? Well, with the consent of users (signed and paid!), This is exactly what we do.
So, can anyone confirm or deny that this is expected, or what I can do about it. This is a little killer for our application. I registered it as an error with Apple and will try to report the progress here.
UPDATE: October 3, 2013
Although the previous answer seemed to work for a while; now it stops working with -12985 because another application turned on the sound. This, of course, is why I need to use the mix flag.
UPDATE:
iOS 7.0.3 (and later) seems to have completely fixed this problem.
source share