[Not a bug] Short pause playing .ogg file for the first time
Moderator: George Gilbert
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
- Trantor
- Duke of Banville
- Posts: 2466
- Joined: Wed Mar 09, 2005 4:16 am
- Location: Berlin, Germany
- Contact:
[Not a bug] Short pause playing .ogg file for the first time
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.
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
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.
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.
- Trantor
- Duke of Banville
- Posts: 2466
- Joined: Wed Mar 09, 2005 4:16 am
- Location: Berlin, Germany
- Contact:
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?
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?