The MediaPlayer.Play method throws a DRM exception ?!

I am trying to add background music to my Windows based XNA 4 game. When i do

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

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

It seems I'm not the only one who has this problem . But the closest I found for a solution is to use XACT.

Any ideas?

Edit: Also, why is my code fragment not syntax highlighted? It was highlighted in the preview.

+6
source share
2 answers

In my case, the problem was that I uninstalled Windows Media Player. For what it's worth, I'm running Windows 7 Professional 64-bit. I reinstalled WMP through the Windows Properties dialog box and the problem disappeared right away. I didn’t even have to reboot.

+5
source

The problem for me was that in my WMAppManifest.xml there was no ID_CAP_MEDIALIB capability.

 <Capability Name="ID_CAP_MEDIALIB"/> 

Hope this helps.

+3
source

Source: https://habr.com/ru/post/885752/


All Articles