3
votes

When the app is in the background and capturing audio fine, and then a call comes in, the capturing is stopped and the proper callbacks are called. When the call is done the proper callbacks are called (audioInterruptionEnded) but if an attempt is made to restart the capture in the background the following is returned by the call

[[AVAudioSession sharedInstance] setActive: YES error: &activationError];

Returns error

 Error activating audio session during initial setup: 
 Error Domain=NSOSStatusErrorDomain Code=560161140 
 "The operation couldn’t be completed. (OSStatus error 560161140.)"

Once the app is moved to the foreground, all startes working again fine.

Anyone know of any tricks / issue on restarting audio capture in while the app is in the background?

1

1 Answers

2
votes

Bad news. From what I understand, you can't. It's either a bug, or a security feature so people don't "forget" they're being recorded (since the phone becomes locked after a call). I couldn't bypass this.