This code works fine when running in the emulator:
menuAudio = ScreenManager.Game.Content.Load<Song>("music\\MenuEntry");
// Kick off the music for the title screen
if (MediaPlayer.State != MediaState.Playing)
{
MediaPlayer.IsRepeating = true;
MediaPlayer.Play(menuAudio);
MediaPlayer.Volume = 1f;
}
But when I run it to debug on the phone I get a UnauthorizedAccessException when trying to play the menuAudio song.
Any assistance would be appreciated.
If you’re doing this with a phone when connected to a PC, be sure to use WPConnect, rather than Zune. See these tips for more information.
Have you confirmed that
menuAudiois valid when you try and play it?