Detect iPod music playing?

Is there a way to detect whether iPod music is already playing when the game starts?

It only makes sense that there should be a way, since there is an option whether or not to override iPod music. Not being able to detect this means the “override” option should probably be renamed to “allow compressed audio in your game?” since if you don’t override iPod music, you are effectively disallowed from using compressed audio in your game - unless you trust that your players will never, ever, try playing their own music before launching your game (which will result in a crash).

In other words, unless there is a way to detect it at startup, unless you choose to always override via the player settings, it is 100% unsafe to use your own compressed audio.

Any ideas?

Brady, do you know what’s crashing?

If it’s Unity, you could possibly trap the code that starts the music.

Maybe something like this:

var music : AudioSource;
var playMusic = true;

function Awake(){
	try
		if (playMusic) music.Play();
	catch(err)
		playMusic = false;	
}

Hmmm, that’s an idea, though I’m using “fast, no exceptions” in the player settings for performance reasons.

Have you tested it, does it actually improve performance?

Because it doesn’t seem to make any difference in my game.

I haven’t tested it in this game, but I tested it in a previous game of mine and it definitely made a difference.