Possible Duplicate:
iPhone/iPad - Loop Background Music?
The official iphone docs aren't bad, but I'm finding them pretty unhelpful on this subject - all I can find is an API for playing midi files, but that's not what I want. I just want to play an MP3 in the background. And if the user is already playing their own music, obviously I don't want to play my own on top of it.
Is there a "correct" way to do this?
Rather than double click the Home button, try pressing the wake/sleep button while you run your game, than start the music from the headset button (or double-click the Home button to access the mini-player). Wake up your iPhone and you'll be back to your game while listening to your music! Enjoy!
Just open whatever source you want to listen to music from (Spotify, iTunes, Windows Media Player, YouTube in a browser) and then start playing your favorite playlist. Now launch the game you want to play and then alt-tab back over to the desktop. In the bottom right toolbar find the speaker icon and right-click it.
The CrashLanding demo app in the SDK has a SoundEngine class that can play background music.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With