building content song from mp3 has an issue

Hello all,

I have added an mp3 file to my content and set it up with:
Importer: Mp3 Importer - MonoGame
Processor: Song - MonoGame

But when I build the content it fails.
The exception message that it provides indicates that the song processor is attempting to open the song as .wma file while I specified that it is an mp3.

How can I fix this?

Have you tried converting it to a wma file?


Also, @Danahi, Welcome to the Community,

Happy Coding!

What does the .mgcb file look like when you open it in the UI? Could you share the raw text of the file?
It should look like this:

#begin (Folder)/(File Name).mp3

Additionally, my music files are being converted to a .xnb equivalent when going through the pipeline.
So the code to import them for playing would be:

Song song = Content.Load<Song>("<Path to file without an extension>");

Do you see .xnb in your Content/bin output? Are you trying to load the Song in the same way?

Thanks for the welcome :smile:.

Sorry, I was not clear enough :frowning:.

However, just when I wanted to reply I noticed it worked :confused:.

Anyways, what was not working:
I have an mp3 file, I wanted to build it (to convert to .xnb so that I can load it in my project via the content pipeline) however even though the mp3 importer and Song format was correctly chosen, the mp3 file failed as a song. When I looked at the error message in the report it mentioned the correct file name at first …/fileName.mp3, but then said that it was not authorized to access …/fileName.wma.

However, just now when I opened the project again, the file was gone, and when I added it this time, everything went “smooth sailing” :open_mouth:

1 Like

Any chance the music file or folder might have been open or had some situation where a write block was in effect that now is no longer in the way?

I did have something like this happen to me recently when I was trying to deploy a UWP game to an XBox One - if that happens to be the case, to me the fix was I wasn’t logged into a profile for XBox Live yet in Dev Mode, and I was being blocked from having access to deploy the file.

1 Like

Hello Cory,

I wasn’t using the file at the time to my recollection.
The weird thing was the mismatch though between the mp3 and wma.
I think somehow, although the GUI displayed that the file had an mp3 Importer, it did use the wma.
The one action I performed before this that may possibly have corrupted the process somehow, may have been that I was cleaning up my git branches and merged into some old branches. But honestly I’m grasping at straws at this point :smile:.

However, I am happy that the problem is solved. Although it is annoying not to know why or how it happened, I am happy to be able to continue the development :smiley:!

Thanks for your help!