I am trying to get comfortable with the pipeline tool , but somehow there is always something messing it up. Probably I am using it wrong?
So, I habe a couple of content files I use (.png, .wav, .ogg and so on) I converted them to .xnb, added the .xnb files to my project and everything works fine. Since I use git, only files used in the project are uploaded (did not mapped the whole project folder).
Now, when I open the project on a different PC, the compiler says
“The source file ‘[…]/Content/Music/filename.wav’ does not exist!”
(in this case I used song = Content.Load(“Music/filename”); )
Why isn’t it using the present xnb files? Maybe I don’t understand something right there? Do I need to Copy the original files as well? That seems pointless to me.
Also, the Content.mgcb says:
Maybe that’s the issue here?
Actually I have no idea whats going on, some help would be appreciated.
Songs consist of two files. The XNB file describes to the ContentManager where the actual compressed streaming file is. When you created the XNB files, there would have been a file of the same name with a .m4a, .wma or .ogg extension. That needs to be copied along with the XNB file (and also go into source control).
Ok, didn’t know that. Thought the .xnb file replaces the original soundfile :-/
I have the same issue with my .spritefont files:
I guess it’s the same reason?
Do I always need the .xnb and the original file or are there exceptions?
Only for songs and videos it outputs two files, the .xnb file and the media file. And it’s not the source file, but the compressed media file that was written out alongside the .xnb file.
SpriteFont only produce a single self-contained .xnb file. You need the .spritefont file and the font file to generate the .xnb, but the .xnb file is the only file needed by the ContentManager.
Thank you for the explanation, works now as intended