AudioStreamer icon indicating copy to clipboard operation
AudioStreamer copied to clipboard

Audio route change causes AS_GET_AUDIO_TIME_FAILED error

Open genzeb opened this issue 14 years ago • 2 comments

When there is an audio route change, an "audio queue get current time failed" error (alert) is thrown. Adding an kAudioSessionProperty_AudioRouteChange doesn't seem help.

The audio time failed error is present out-of-the-box.

genzeb avatar May 13 '10 05:05 genzeb

I'd added handling of the "audio queue stopped error" in the progress method. I'll close this bug when I'm sure that's enough.

mattgallagher avatar May 14 '10 01:05 mattgallagher

That fixes the problem ... the nice thing is the playback continues from the same point on the new audio output. I am not 100% how that happens though. The only interruption handler seems to pause the player on both begin and end interruption:

- (void)handleInterruptionChangeToState:(AudioQueuePropertyID)inInterruptionState
{
    if (inInterruptionState == kAudioSessionBeginInterruption)
    {
        [self pause];
    }
    else if (inInterruptionState == kAudioSessionEndInterruption)
    {
        AudioSessionSetActive( true );
        [self pause]; // Shouldn't this be start??
    }
}

The streamer works beautifully, so who am I to argue. Thank you for taking care of this as promptly as you've.

genzeb avatar May 15 '10 03:05 genzeb