문제

I am currently using an AVAudioPlayer to play looped music in the background of my app. However, when siri is opened in my application it turns it off. I am farly experienced with objective c but I cant seem to get this to work. Is there any way I can tell when a user opens siri so that I can start the AVAudioPlayer again after it stops. Please help! P.S I have attempted continuously playing the audio but then siri wont work.

도움이 되었습니까?

해결책

You can use AVAudioPlayerDelegate's audioPlayerEndInterruption:withOptions:

- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player withOptions:(NSUInteger)flags {
      [player play];
}

다른 팁

For anyone else coming to this, the endInterruption delegate isn't getting called from me when my app gets interrupted by Siri. I had to make the app resume playing when it becomes active again (using a notification).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top