1

If I use a pre-initialized items to construct a AVQueuePlayer, the sound can come out without problem. But I wonder is there any way to change the item in the list of the player when background?

I am developing a alarm clock app for my first project. And I found there is one alarm clock app can wake up people with IPod Music even when it is on background mode! I deadly want to know how to implement it, thank you.

Luke
  • 11,426
  • 43
  • 60
  • 69
Sevear Liu
  • 61
  • 6

1 Answers1

0

I wouldn't use an AVQueuePlayer for an alarm clock.

In order to use sounds from the iPod Library, I'd let the user pick a song. Then after he picks a song using the AVAssetReader I'd copy the song in the documents folder of the app. After that I'd set up a local notification at the time of the alarm using that song as the sound for the local notification.

thealch3m1st
  • 106
  • 4
  • Thanks for your help. But if I use the local notification, I cannot play a sound file more than 30s and it looks like that a local notification can only use a sound file in the main bundle. Those are why I choose AVPlayer or AVQueuePlayer to play alarm sounds. – Sevear Liu Dec 04 '11 at 02:59
  • What's the name of that app? If you can get your hands on the unencrypted binary (the ones used on the jailbroken devices when you downloads stuff from Installous) you could use class-dump to dump the header files and looking at those you might get the hang of what's going on :) – thealch3m1st Dec 06 '11 at 20:12