0

I'm currently going through a book which teaches XNA. I have followed all the instructions to add background music but for some reason I keep getting this error:

An unhandled exception of type 'Microsoft.Xna.Framework.Content.ContentLoadException' occurred in MonoGame.Framework.dll

Additional information: Could not load Gobbledigook asset!

I have access to the media library and this is my line of code

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

The song "Gobbledigook" is in my Content map and these are the properties

Does someone know what I am doing wrong?

Community
  • 1
  • 1

1 Answers1

0

This is happening because XNA (and MonoGame) Content Manager cannot load your audio file in its MP3 format. It will have to go through Content Build Pipeline first. MonoGame has its own pipeline ready for the job.

Firstly, open up Content.mgcb located in your Content folder (using Solution Explorer). Tool called MonoGame Pipeline should be opened now which you can use to import your assets.

enter image description here

If you build your project now, you can notice the WMA and XNB files in bin directory.

Hope this helps!

Markkknk
  • 406
  • 6
  • 13