Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MediaPlayer.Play method throwing DRM exception?!

Tags:

xna

xna-4.0

I'm trying to add background music to my XNA 4-based Windows game. When I do

Song bgm = Content.Load<Song>("bgm");
MediaPlayer.Play(bgm);

in the MyGame.LoadContent method, I get an InvalidOperationException with the message "Song playback failed. Please verify that the song is not DRM protected. DRM protected songs are not supported for creator games." The song is in MP3 format and is not protected. I tried using a WAV instead and the result was the same.

It seems I'm not the only one having this problem. But the closest thing I've found to a solution is "use XACT".

Any ideas?

Edit: Also, why is my code snippet not syntax highlighted? It's highlighted in preview.

like image 483
Adam Siler Avatar asked Apr 12 '11 19:04

Adam Siler


2 Answers

The problem in my case was that I had uninstalled Windows Media Player. For what it's worth, I'm running Windows 7 Professional 64-bit. I reinstalled WMP via the Windows Features dialog and the problem went away immediately. I didn't even have to restart.

like image 73
Adam Siler Avatar answered Sep 28 '22 18:09

Adam Siler


The problem for me was that I was missing the ID_CAP_MEDIALIB capability in my WMAppManifest.xml.

<Capability Name="ID_CAP_MEDIALIB"/>

Hope this helps.

like image 35
mikeesouth Avatar answered Sep 28 '22 18:09

mikeesouth