Objective: To find out the difference between using cues and not using them in a sound file in the Half Life engine.
Procedure: The theory is that, for audio files to be looped, there has to be one cue at the start of the file and one at the end. The test uses six separate sound files, all containing the same 4-second audio data but different cues.
They are set as follows:
One file with no cues at all.
One file with 1 cue, set at 0:00
One file with 1 cue, set at a random point different than 0:00 (set at 0.5s)
One file with 2 cues, the first at 0:00 and the last at the very end (4 sec)
One file with 2 cues, in two random locations different than the very ends (set at 1.5s and 3s respectively)
One file with 3 cues, in three random locations different than the start and end (set at 1.5s, 3s and 3.5s respectively)
The test is arranged in four groups of tests. All ambient_generics have the "play everywhere" and "start silent" flags.
The first group of 6 ambient_generics are individually triggered and are toggled.
The second group of 6 ambient_generics are also individually triggered, but are also set to "not toggled".
The third group of 6 ambient_generics are toggled and triggered all at once by a single button, to demonstrate how they all end up out of sync due to differently placed cues.
The fourth group of 6 ambient_generics are not toggled and also triggered all at once by a single button.
Test Results:Sound files with no cues will not loop at all, even if set to toggled ("toggle/not-toggle" flag has no effect).
Sound files with cues will play the first time from 0:00 to the very end, and then loop between the first two cues. If only one cue is present, it will loop from said cue to the end of the file.
If two cues are present and they are at each end of the file, the sound will loop from start to end; but if said cues are placed at random points in the file, the complete audio will only be heard once, at least until the sound is turned off and then back on.
Files with three or more cues will only use the first two cues and ignore the rest.
Sound files with cues will
always loop, regardless of the "toggled" flag; but there
is a difference. If set to toggle, the sound can be toggled on/off any time. If the flag is set to not toggled, there will be
no way to turn the sound off. It will only ever be silent if "start silent" is used, and only until it is triggered. Further triggering will only cause the sound to jump back to 0:00 and continue playing (looping between its cue points, if set)
As always, I hope this will serve as a working example of generally unexplored engine features (being mostly edge cases), and that others will find this an useful and interesting learning experience (and maybe even find inspiration to push the engine even further)
Love to all,
DiscoStu
interesting, i'll have to DL tomorrow
Superb work sir! this should be written up as a tutorial too!
EDIT: LOL it creates quite a cacoughpanously awesoome sound when you willy-nilly start pressing all the buttons! All kinds of ideas are popping up in my haed for some multiplayer maps using all these togglable sounds, but i'm sure it would wreak some seriousl havoc on a server.
Then get the trigger_auto to turn the looping sequence on (or you can turn it on in any other way).
name the trigger_relay 1; relay1, name the trigger_relay 2; sound, name the ambient_generis; sound. Then make relay1 trigger sound, and make relay2 trigger relay1, with delay values being the wait between each time the sound is played. This way it will never turn off, the loop.
You can take it a step further at that, by adding a random trigger to make it trigger randomly lets say every 11, 3 or 7 seconds (the sound). This method is great for ambience in CS 1.6.
As Captain T said, you should save this in the tutorials section too. It will be easier to find it when it's needed.
@Tetsu0: Try GoldWave, it's free if it still exists. It's also ancient. Maybe Audacity can do that too.
@Cap'n & doggybag: I might do a tutorial, but there already are two tutorials on custom sounds and I fear this alone is not worthy of a tutorial. I'll try to write something up, though. Meanwhile, I posted a link to this at the custom sounds tutorial.
@Skals: Sure you can do that. I just meant sounds with no cues won't loop automatically. Also I suspect that method won't loop as perfectly.
Thanks.