1

I'm working on a walking tour that uses iBeacons and geofences. I'm trying to allow my users to plug in their headphones, close the app and get audio updates as they walk around.

I have the basics of this down and can trigger audio when the app is foregrounded. I've also implemented the playing silence trick and playing/pausing an AVQueuePlayer instance in the background that has started while the app was foregrounded.

My challenge is being able to control the state of the AVQueuePlayer in the background so that I'm playing the right track at the right time - it's a non linear experience. I have about 2 dozen tracks at the moment. Is there a way I can queue all those up in order, and target to queue player to play a specific index or is there a way to add and remove items to the queue in the background?

Any other thoughts on how my problem can be solved? The best advice I've been given so far is to try to attach audio to a local push notification, but the 30 second limit is really not ideal.

nwales
  • 3,521
  • 2
  • 25
  • 47
  • I have one other solution. It's pretty horrible, but I tried it and it will work. If I create multiple AVAudioPlayer instances initialized with a different audio file I can then switch to the background and play anyone of those players selectively when the app is backgrounded. Now if I just create 24 of these... – nwales Jul 17 '14 at 21:24

0 Answers0