iDevGames Forums
AVAudioPlayer stutters the game when changing song - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: AVAudioPlayer stutters the game when changing song (/thread-60.html)



AVAudioPlayer stutters the game when changing song - AdrianM - May 13, 2010 03:59 PM

I'm developing a game that feautures background music that changes everytime the current track changes. I'm using AVAudioPlayer for this but i'm experiencing some issues.
Here's how i do it: Load all the tracks with a separate AVAudioPlayer object, pre play them and start only one track at any moment. If the current track has finished playing pause it and set the current time to 0. Now play the next track. At transitioning i experience fps drops and the game stutters for a little while. What can i do to improve this?