Tutorial: Making Custom Sounds Last edited 3 months ago2024-09-20 11:04:32 UTC

Download attachment

Custom Sounds: we all love them, we all try them, but most of us fail miserably. The reason? Most of the sounds in HL are looped. This means one short sound that has been created so that the end of it will fluently run into the beginning, as with textures. A badly looped sound is just as bad as a badly tiled texture.

Previously, there has been some confusion over what format a sound must have to be accepted into the game. However, after much investigation and several heated arguments in forums, I can reveal that all sounds must be: There are two methods of obtaining a custom sound - from the Internet, or from the ambience itself, using a microphone. If you get the sound off the Internet, skip to "Creating the Cue Points".

Obtaining a sound using a microphone

What you're gonna need: The biggest problem with making an ambience sound from your own home, for example, is getting the sound to your PC. There are many other methods including Dictaphones etc, but none match the quality of a professional microphone. So you have 4 choices: Each option has both advantages and disadvantages, but in the end all achieve the same result. In this case, I am going to use a radio mike, but it's not important.

When recording your sound, make sure you have no disturbances. The last thing you want is a computer buzz with your bro screaming "MUM!!!!" in the background! No, seriously, what I mean is microphones can be extremely sensitive, so unless you are using good software with cancellation abilities, chances are you'll pick up something else as well.

When positioning a mike, it's always good to use a stand where possible, as laying a mike on a smooth / hard surface while recording will result in unwanted vibrations being picked up. You also want to place your microphone about 2 inches away from the source. This will mean a good pick-up, but no unwanted sound.

Finally, listen to your sound before recording. Why? Tremolo. All sounds have tremolo, an audio characteristic that, if strong, gives the sound a pulsing effect. The stronger the tremolo, the faster the sound will pulse, giving it a natural cycle. A weak tremolo is either unnoticeable, or will pulse very slowly. If the tremolo is noticeable in your sound, it is vital that you record at least one cycle of it. The example map download includes a sound with strong tremolo and one with weak tremolo so you know what I'm talking about! Below are two examples of weak (top) tremolo, and strong (bottom) tremolo. You can clearly see that stronger tremolo has much shorter waves than the weaker tremolo: about eight oscillations of the strong tremolo fit into one cycle of the weak tremolo. The horizontal scales are equal. These sounds are provided in the example ZIP at the end of this tutorial for your listening pleasure.
Weak tremoloWeak tremolo
Strong tremoloStrong tremolo

Recording your sound

Once your mike is ready, load up a new session in your editing program and change its attributes to those at the beginning of this tutorial. THIS IS ESSENTIAL! Start your sound 'emitter' if necessary, and then start the recording. Only stop it when you are sure that it has passed through at least one natural cycle. Now, save your sound, and remember, WAV format only!

Preparing your sound for HL

Now here's the tricky part - making the sound smoothly repeatable. Although I can guide you through this section, in the end, it is down to human skill and patience. It also helps having a good ear for music! I mainly only create 'single-play' custom sounds because it is so much easier to make it sound professional! If you've followed this tutorial so far, you should now have a rough sound that includes one full natural cycle. We now want to take that down to just the cycle. This will mean endless playback of the sound, which will get rather annoying by the end, but its well worth it!

Now, using a cut, trim, splice, whatever tool available on all good audio editors, you need to slowly trim away at your sound from both the beginning and end until you are near the natural cycle. Now, turn on cycle / repeat at this point, because it's here that you need to be precise. Take 1/100 of a second off at a time if necessary, but get that sound sounding good! Ok, so I gather you've done that now, preferably without smashing your computer to pieces. And if you have, well, don't blame me!

Creating the Cue Points

You now need to create the cue points, the last but most vital part of creating a looping sound. A cue point tells the game where the sound should begin and where it should end. Without them it would either never start, or never repeat - in other words, it's not good! In most editors you can probably do it similarly to this:

For Cool Edit 2000

Inserting your Custom Sound into HL

Now all you need to do with your correctly-formatted audio file is place it correctly in Half-Life's directory structure and put it in your map. Pretty simple: you can put the sounds anywhere in Half-Life/modname/sound. You can organise your files in subdirectories if you so desire. In Hammer, you should specify the path to the sound in the form subdirectory/sound.wav, i.e. just foo.wav if your sound is just in sound, or bar/new/foo.wav if it's in the bar and new subdirectories. You may wish to check the ambient_generic entry in our HL entity guide.

3 Comments

Commented 13 years ago2011-12-30 11:24:13 UTC Comment #100721
Just made an example map for those interested in the possibilities offered by cue points, explaining some minor points not covered here:

http://twhl.info/vault.php?map=5723
Commented 12 years ago2012-04-19 16:07:51 UTC Comment #100722
No there a certain mp3 version that half life can play
Commented 9 years ago2015-03-22 01:14:36 UTC Comment #100723
Hey, I thought you could just chop the sound off at the zero crossings at the beginning and end of the waveform in your editor to get a proper loop. It works when the "Looped" flag is checked in Hammer - and it seems like it would be a space saver. Also, there are hand recorders that you can purchase. I use the ZOOM H1 Handy recorder. $99 and you can capture 24-bit audio up to 96Khz. You can get stunning quality audio that doesn't take too bad of a hit when you're optimizing it for GoldSrc - provided you record at the proper levels.

I would like to see an advanced sound tutorial on voice acting and doing scripted sentences for NPC's.

You must log in to post a comment. You can login or register a new account.