tags:

views:

3909

answers:

2

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?

+9  A: 

Since you are wanting to play an mp3 (or any other compressed format) you are going to have to use Audio Queues. I am using the GBMusicTrack class that was posted here http://www.idevgames.com/forum/showthread.php?t=15280 and it works great.

As for how to detect if they are currently using the ipod app to play back music i have no clue.

Lounges
I can confirm it works great
Dave Verwer
+5  A: 

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

Kristopher Johnson