I made a streaming music player and it works fine in the foreground.
But in the background iOS4, it doesn't play the next song automatically. ( remote control works )
The reason is AudioQueueStart return -12985
.
I already check the audio session. it just fine. I use AudioQueueStart
when it start to play the music.
How can you remove AudioQueueStart
?
- (void)play
{
[self setupAudioQueueBuffers]; // calcluate the size to use for each audio queue buffer, and calculate the // number of packets to read into each buffer
OSStatus status = AudioQueueStart(self.queueObject, NULL);
}
I read the answer in the web about the AudioQueueStart
fail subject.
One thing to check is that the AudioSession is active first. In my case, I had previously set the session to inactive between song changes before starting a new song:
AudioSessionSetActive(false);
Once I removed this AudioQueueStart works just fine from the background.