I have concerns regarding music.
I'm porting my game from Multimedia Fusion 2, where I used OGG format files for music not only because that was all it supported but because I want to keep myself out of legal issues. They are loaded externally because I'd like to have my players able to replace the music if they want.
However, as the documentation states, XAudio2 does not do OGG as music unless you have the codec for it. I figured it would not be much of an issue to have players install this codec, and I already had it installed, so I decided to try that out.
But there are problems with it. Namely, when loading these OGG files it cuts off about the first half-second of each file. That sounds funny, but I can't add a half-second gap to compensate because the files are designed to loop.
So, I tried the backup plan, loading the music as a sound, which also conveniently eliminates the pesky codec. I locked up the first channel and let the music go on that. However, this causes the game to skip 20-30 frames (at 60 fps v-synced) while it loads because as the documentation states it decompresses the OGG first. I tried making it pre-cache the files, but this only works the first time the music is loaded-- after a song is switched out it seems to dump it from the cache meaning if I want to reload a song (and I do) it'll freeze again.
I'm guessing it is overall an OGG problem, as it requires either a codec or decompression before playing, but I am in a rather tight spot. I cannot really use any other music format. My game will probably be sold, which automatically knocks MP3 and WMA off the list. Both require licensing fees, and MP3's for instance is $2500 per title for games. WMA's is less, but still is inacceptable for a game being built on zero budget. That leaves WAV, which is freaking huge-- not good for digital distribution and it could even overflow the size of a CD if I tried to put the game on CD. OGG is essentially the only choice I have apart from MOD music, which I would prefer not using because I have actual music software at my disposal that gives me much more freedom.
So how exactly can I switch between musics quickly without either losing the beginning of the tune or having the game freeze for a sec?