Frage

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.

War es hilfreich?

Lösung

You can use AVAudioPlayerDelegate's audioPlayerEndInterruption:withOptions:

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

Andere Tipps

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).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top