Page 1 of 1

[Not a bug] Short pause playing .ogg file for the first time

Posted: Thu Jan 25, 2007 12:46 am
by Trantor
I built two level that are connected via ladders. Clicking the ladder also activates a trigger that activates background music. When I add the background music in the .ogg format, there is a short pause (about half a second or a second) where the game freezes before it continues to work as normal. However, this pause only comes up the first time a particular music is played, there is no freezing when you click the ladder again later. This pause does not exist if the background music is an .mp3 file, so I suppose it has something to do with the .ogg format. I can send you a savegame if need be.

Posted: Thu Jan 25, 2007 10:29 am
by George Gilbert
I would imagine that the sound libraries are decompressing (or some other such initialization of) the OGG file when it is first loaded and so there is absolutely nothing I could do about that. I'll have a look to see if it's a known issue with OGG files though and whether there's a patch available for Windows that fixes it.

As far as RTC is concerned, it handles all sound files in exactly the same way (i.e. it just tells Windows to play them; it doesn't look at the type or contents at all). In fact, it doesn't even know it's an OGG file, just a long stream of bytes that it passes to someone else to deal with.

If the gap is a problem, how about adding a trigger at the start of your dungeon to play and then immediately stop the sound on another level (so there's no possibility of you hearing it). That way the sound will be loaded and ready to play "properly" when you really need it.

Alternatively of course (and I appreciate that this is somewhat of a cop out), try converting the file into MP3 format! Each of the sound formats have their advantages and disadvantages and you need to make sure you're using the format that gives you the best results.

Posted: Thu Jan 25, 2007 11:13 am
by Trantor
Thanks for the quick reply George. I tried your suggestion of starting and immediately stopping music upon entering the dungeon, and while now the gap is there before you can move around, I think this is less of a problem for the player.

I wanted to avoid mp3 files for two reasons: a) Because of the little pause when looping an ambient music, and b) because ogg files take less space. I am planning on having quite a number of different musics in my dungeon, and I don't want a file of 15 MB for the players to download. I am undecided what exactly I will do for now, but both solutions are reasonable. I just suspected this might be a bug that could be fixed.

Btw, have you received my email with my record of CSB for the gHoC?