dimanche 21 décembre 2014

Playing a sequence of audio clips in the background after a delay

I would like to schedule a series of local audio tracks to play in sequence while my app is backgrounded or the device is locked, and after a delay. Furthermore, each track should only play a fixed duration sample. For example:



  • User presses a button in my app.

  • User locks device.

  • After x minutes, tracks A, B, and C each play for y seconds in sequence.


How might I accomplish this?


My current Best Hope is to schedule these in an AVPlayerQueue since if I set up the queue correctly the background audio should then 'just work'. But I don't see any way to set a duration for each AVPlayerItem. I also don't know how to set an initial delay, though I would consider using looping a silent audio clip if that is the only obstacle.


Aucun commentaire:

Enregistrer un commentaire