Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I play background music in my iPhone game? [duplicate]

Tags:

iphone

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?

like image 334
Laurie Cheers Avatar asked Oct 08 '08 14:10

Laurie Cheers


People also ask

How do I play music in the background on my iPhone while playing a game?

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!

How can I play music and play a game at the same time?

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.


1 Answers

The CrashLanding demo app in the SDK has a SoundEngine class that can play background music.

like image 180
Kristopher Johnson Avatar answered Nov 02 '22 23:11

Kristopher Johnson