Don’t put the .xnb after “song.” That should fix the problem. The game won’t use the .wma at all, from what I understand. If you still have issues, locate the song.xmb file and manually copy it over into Debug > Contents.
Song loading should look like this:
song = Content.Load < Song >(“song”); //No space between brackets, although technically it doesn’t matter
Check your Contents folder. To do this, from your project folder, go to bin > Windows (if using Windows) > Debug > Content. If it contains an xnb file named “song”, it should be working,
Also, side note, are you using a 32 - bit system? That shouldn’t matter if you already have xnb files compiled, but the content pipeline only builds xnb files on 64 - bit systems.
You mean in the solution explorer? Make sure to check the actual Debug/Content folder using File Explorer (i.e. outside of Visual Studio), because that’s where the build accesses files and where there’s going to be problems if the file isn’t found. If it is there, I don’t know why it wouldn’t be building right, unless there’s compatibility issues with WMA files. I only use WAV.
Huh. Weird. Well, this is what I see when I expand the Content folder in the Solution Explorer.
And I have a lot of Texture2Ds and SoundEffects I use. Maybe it doesn’t matter, but it could have something to do with the way you’re importing content files.
Have you tried using MonoGame’s content pipeline? Unless that’s what you mean by XNB builder tool. Also, sorry, I didn’t read your posts clearly enough, I was asking questions you had already answered.
Definitely try using Monogame’s built in content pipeline. To open the content pipeline GUI, go to [Project Name] > Content, then double click “Content”, which should have the Monogame icon next to it. Note that this Content folder is different from the one in the Debug folder; it should be found in the same directory as “bin” and “obj”.
Once you’ve opened the GUI, go to Edit > Add > Existing Folder, then find your art folder and press OK. Next, make sure the Content folder is selected on the left, not the art folder, and then go to Edit > Add > Existing Item, then find song.mp3 (not song.xnb), and press OK. Now go to Build > Build, and say yes when the prompt asks if you want to save the project.
Now when you run the project from Visual Studio, the .xnb files that were generated by Monogame’s content pipeline should automatically be added to the debug folder. If they’re not, you can copy them manually.
Oh, and if you do use the content pipeline, the places where .pngs are loaded should have the .png extension removed, since the project will be using xnb files, not .png files. I’m pretty sure that being able to directly load .png files using Content.Load is a legacy feature from back when Monogame’s content pipeline didn’t exist.
Well that’s weird. Try clicking debug the program so you can see what type of exception is thrown. Also, you shouldn’t need those “bin” and “obj” folders in there, unless they contain content you’re trying to build.
At this point, I’ve pretty much run out of ideas. Maybe someone more knowledgeable will see this and be able to help you better. Sorry about that.
@KonajuGames@Tom Any ideas why the content pipeline might be throwing that exception? I’ve never seen it before, and the MSDN documentation says its an obsolete API.
Looks like you’re getting errors from having the bin and obj folders in [Project Name] / Content. Open the pipeline GUI again, right click the bin and obj folders, and remove them. I could be wrong about that, though.