iOS4: after interruption, AudioQueueStart() while in background returns -12985
iOS4: after interruption, AudioQueueStart() while in background returns -12985
- Subject: iOS4: after interruption, AudioQueueStart() while in background returns -12985
- From: John Michael Zorko <email@hidden>
- Date: Fri, 06 Aug 2010 21:03:20 -0700
Hello, all ...
I'm running into an issue, and i'm hopeful that someone here can illuminate me. When my app goes into the background while playing audio, all is cool until the user tries to make a phone call. If they try to make the call, then immediately press End Call, AudioQueueStart() returns -12985. Here is my interruption handler:
void MyAudioSessionInterruptionListener(void *inClientData, UInt32 inInterruptionState)
{
AudioStreamer *myData = (AudioStreamer *)inClientData;
switch(inInterruptionState)
{
case kAudioSessionBeginInterruption:
myData.wasPaused = !myData.isPlaying;
NSLOG(@"begin interruption: wasPaused:%i", myData.wasPaused);
AudioQueuePause(myData->audioQueue);
AudioSessionSetActive(NO);
break;
case kAudioSessionEndInterruption:
{
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty (kAudioSessionProperty_AudioCategory,
sizeof (sessionCategory),
&sessionCategory);
AudioSessionSetActive(YES);
if (!myData.wasPaused)
{
NSLOG(@"end interruption: player was not paused, starting audio");
OSStatus stat = AudioQueueStart(myData->audioQueue,NULL); // this returns -12985
NSLOG(@"end interruption: player was not paused, started audio result %i", stat);
}
else
{
NSLOG(@"end interruption: player was paused, not starting audio");
}
break;
}
}
}
I tried with and without setting the session active / inactive, but the problem remains. Any assistance would be much appreciated :-)
Regards,
John
_______________________________________________
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