4
\$\begingroup\$

I'm having a problem. I've been adding .wma files to the Content Pipeline app to be used as my game's background music. But today when I opened the solution/project/content/bin/music folder I spotted the following:

Problem

So am I forced to ship the .wma files with the actual XNBs when I distribute my game? No other asset gets copied like this so how do I prevent songs from being copied as well?

If I delete the .wma files manually then the next time I build the project they get automatically added again :/

\$\endgroup\$
1
\$\begingroup\$

That is the way the content pipeline works. If you look at other games that use XNA or MonoGame, you may see wma files in their content directories where they're installed. I believe it's the same for mp3 format.

If you want to make it harder for people to copy your music, you can convert them to wav files and then process them through the pipeline. You could also try using XACT to build a wavebank instead, which may further obscure your audio files.

The bottom line, though, is that by distributing your game, you're also distributing your music (albeit packaged in different format). So if they really want to copy it, they'll find a way. They probably can just use the code in MonoGame's source that processes the x*b files.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I tried using .wav but the .wma files were still getting generated...Does XACT work with MonoGame too? \$\endgroup\$ – PowerUser Mar 23 '16 at 19:49
  • \$\begingroup\$ There is plenty of implementation of Xact processing in MonoGame's source code, but there are still a few open issues with it. It may suit your needs. Also, I believe Rogue Legacy used wavebanks and a fork of MonoGame called FNA. That may be worth trying out if MonoGame doesn't handle your wavebankd correctly. \$\endgroup\$ – paste Mar 24 '16 at 0:46
  • \$\begingroup\$ Also, I just tried using the MonoGame content pipeline tool with a wav, and it's didn't generate a wma file. Did you clean the output directory before building? Also, did you make sure the preprocessed wma files were removed from the project? \$\endgroup\$ – paste Mar 24 '16 at 1:46
  • \$\begingroup\$ Alright, I will remove the .wma files from the project, build & clean from both VS and Content, delete the .wma files and then add .wav files. Then I will build them and see if I get .wma files (I'm almost sure I will). Might be worth reporting that to the devs if it indeed happens. \$\endgroup\$ – PowerUser Mar 24 '16 at 15:23
  • \$\begingroup\$ If you delete the .wma does the game still work and play the music? If so might be able to just delete them on release. Or do the xnb require the wma? \$\endgroup\$ – lozzajp Aug 25 '16 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.