I am currently working on an XNA game, however when i command it to play a mp3 file it throws a DRM error when my file is not DRM protected. Can anyone explain to me why this is happening?
开发者_Go百科 public class SoundEffects : GameComponent
{
private Song explosion;
private Song thunder;
public SoundEffects(Game game):base(game)
{
explosion = Game.Content.Load<Song>("explosion");
thunder = Game.Content.Load<Song>("thunder");
}
/*protected override void LoadContent()
{
explosion = Game.Content.Load<Song>("explosion"); // Put the name of your song in instead of "song_title"
thunder = Game.Content.Load<Song>("thunder"); // Put the name of your song in instead of "song_title"
}*/
public void playMusicThunder()
{
MediaPlayer.Play(thunder);
}
public void playMusicExplosion()
{
MediaPlayer.Play(this.explosion);
}
If you attempt to play a song file while the device is connected to the PC via Zune it will throw an exception (DRM). You can either test the game after disconnecting the device or instead of using Zune use the WPconnect tool (which I believe was in the October WPDT update)
精彩评论