Blog

News, updates, and other wonderful things

Posted on Jul 10, 2012

I've been working with XNA's MediaPlayer class a lot lately, and I've come to learn many of the typical pitfalls associated with it. (Hint: There's approximately a million of them)

One of the biggest is the fact that it's so slow. I mean, it will literally slow your game to a crawl if you check Volume more than a few times every few seconds. However, I'm getting off-track here. Maybe I'll go into that in some other post.

For now, I'm going to post about something much more important. You see, XNA has this nifty feature that will mute either your Music category in XACT, or the MediaPlayer class, when the user starts to play music through the Guide. This is fantastic, and I've never had a problem with it (I'm an XACT man, myself), until I started using MediaPlayer for my Custom Playlists (so the user can play their own music in-game).

MediaPlayer pitfall #1,000,001: While MediaPlayer will mute your music when music is played through the Guide, it will not resume your music if that music from the Guide is turned off! Like a spoiled, bratty kid, it will do half of what it's told, but then firmly dig in and say "Screw you!".

So, then, how do we go about fixing this behavior?

Read more