.XNBs too bloated?

I have a SoundEffect I need to play that is approximately 8mb. However when it goes through the pipeline, it balloons over to 60mb in size. This almost quadruples the memory usage of my application. Is there any way to make the file size smaller?

I guess that’s your game music. Use the Song for that (which works with mp3), not SoundEffect (which only works with wav) :slight_smile:

If it really is some crazy sound effect then you can still reduce quality (might not work on some platforms below a certain point) and switch from stereo to mono (works everywhere and phone speakers are mono anyway).

Yeah, I tried using Song, but apparently MediaPlayer is broken or something.

Try the latest version. MediaPlayer is working fine for a while now.

Are you sure? I am using MonoGame 3.2.2 and it still throws up the same exception.

We have SongArc available for Windows Phone 8 for a really long time now and it’s main purpose is to play songs :smiley:

I recommend you to get the latest sources from GitHub, generate the project files by running protobuild.exe in the root, then add the monogame project to your solution and reference that instead of the “stable” versions. This way you will be able to see the real error and work with the latest and greatest version.

This might seem like a dumb question, but I’ve cloned the project on GitHub, and ran protobuild.exe. How do I reference the the monogame project? I don’t see any .DLLs.

Was the compilation from wav to xnb done in Release mode ? Couse then xnb is compressed.
Generally xnb is a pain. On iOS raw wav and image files are used. I’m wondering if that could also be possible on Android/Windows.

Add the MonoGame.WindowsPhone project to your solution then reference that project from your game.

Visual Studio doesn’t allow me to reference solutions or .csprojs.

Right click on your solution -> Add -> Existing project, then select the csproj. After that you can add it as a reference by selecting “Solution” on the left of the add reference panel.