2

I'm trying to add a music file to my project, but I get the error "Could not load EpicScores.wav asset!"

I load the music file like this:

Song sound1 = Content.Load<Song>(@"EpicScoreCreatorOfWorlds.wav"); 

I've tried both with and without the .wav ending.

My file is added to the Content folder, and I've made sure my file properties are set to the "Content" build action and to "copy always."

Why do I get this error and how can I fix it?

3 Answers3

2

Per this thread on the MonoGame forums, this appears to the result of a legacy MonoGame feature that allowed the loading of unprocessed .wav files via the content pipeline API without actually using the content pipeline.

You should leverage the content pipeline to load your assets (the content pipeline will transform your assets from their source format to a more suitable runtime format; that's why you don't need the file extension in the load call, because you're actually loading a different kind of file than you'd think).

This involves creating a content project for your content, adding the music asset and setting the content processor for it (as you've previously set the build actions; you probably want MonoGame Song in this case).

1

http://jaquadro.com/2013/11/migrating-monogame-projects-to-vs2013-and-windows-8-1/

I found out how I can get Content Pipeline to work for Visual Studio 2013, in the above link.

  • You should add more to your answer, such as the steps you took. Link die over time. You should then accept your own answer. –  Feb 09 '14 at 19:08
0

If i am correct you cannot load .wav files as 'song'. wav files may only be used as 'Sound Effects' .you can convert the file to .wma and then use it.U also have to create .xnb file. For a song to play on windows 8/windows phone ,u have to copy both the wma file and xnb file to the content folder.

Here is a solution that i created by modifying 'Xnacontentcompiler' which is an opensource project.

http://1drv.ms/1drPvzv

run xnacontentcompiler(assuming you have xna4.0). use the format converter to convert file to wma and then create xnb file for that wma. now copy both the xnb and wma to your content folder,change property to content and copy always and load the file like you normally do.

Sidney
  • 23
  • 7