i try to use freestreamer to play music, a call coming when app in background, the music can stop, but if the call end(CTCallStateDisconnected), the music can not resume again, it can catch the status when the call end(AVAudioSessionInterruptionTypeEnded) in the FSAudioStream function which named
} else if ([interruptionType intValue] == AVAudioSessionInterruptionTypeEnded) {
if (self.wasInterrupted) {
self.wasInterrupted = NO;
@synchronized (self) {
[[AVAudioSession sharedInstance] setActive:YES error:nil];
fsAudioStreamPrivateActiveSessions[[NSNumber numberWithUnsignedLong:(unsigned long)self]] = @"";
}
if (self.wasContinuousStream) {
/*
* Resume playing.
*/
[self play];
} else {
/*
* Resume playing.
*/
[self playFromOffset:_lastSeekByteOffset];
}
}
}
and the app can also catch the kFsAudioStreamPlaying status in background, it mean start to play the music again , but i can not listen the music at all !!!! can somebody know how to solve this issue? by the way i also set the
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
to support the background play.
update 27/5/2015:
i have read something about :Background audio doesn't resume after a call, in this case have catch this interruption notification in code, also can detect the call end status and restart the music , but have no sounds at all