I am developing an audio stream and declaring an interruption listener in order to preserve the state of the song when the interruption occurs - like an incoming call or SMS.
Here is the relevant code
In my AppDelegate I have this
AudioSessionInitialize (NULL, NULL, interruptionListenerCallback, self); AudioSessionSetActive(YES);
This is what the interrupt listener looks like
void interruptionListenerCallback (void *inUserData, UInt32 interruptionState) {
}
When I receive a phone call, the interrupt listener is called, and if the user rejects the call, the resume resume method is also called. But before calling the resumePlayback method, I get this error in the console for AudioQueueEnqueueBuffer
error: tca! int error: 560030580
Does anyone have an idea on how to properly handle audio interruptions when streaming audio files.
Thanks.
iphone audio streaming
lostInTransit
source share