Chapter XIV. Sounds.

Sound design: placing ambient sounds, room acoustic effects, and looping audio.

14.1

Basic Sounds (ambient_generic)

In this article we will tell you how sounds are inserted onto maps. Before reading the article, we recommend that you familiarize yourself with the following entity object: This is one of the shortest articles in our Tutorial, because... Inserting sounds onto the card is very simple and fast. For this purpose, one single object is used ambient_generic. Insert this object at the location on the map where you want the sound to come from.
Object ambient_generic has quite a few properties, but only a few of them are used in practice.
Name — if you give the sound a name, you can turn it on and off with a button or trigger;
Path/filename.wav of WAV — here you need to specify the path to the sound file in wav format;
Volume (10 = loudest) — sound volume. Values ​​range from 0 to 10, with 10 being the loudest.
The remaining parameters determine various sound effects and are used extremely rarely.
Flags:
Play Everywhere — if checked, the sound will be heard throughout the entire map, i.e. from any point;
Small Radius — if checked, the sound will be heard at a short distance (up to 800 units);
Medium Radius - the same thing, only at medium distance (up to 1250 units);
Large Radius — the same thing at a long distance (up to 2000 units);
Start Silent — if checked, the sound will be turned off at the beginning of the round and will need to be turned on with a button or trigger;
Is NOT Looped — if checked, the sound file will be played once, i.e. it will not be repeated time after time. To play the sound again, you will need to activate it again.
Sounds bring the map to life. But use them in moderation, do not use annoying sounds (example: the hum of turbines on DE_PRODIDGY). The sounds should not be loud so that players do not have the desire to bind a command to any key STOPSOUND (muffles the playing sound :). If you have a lot of bushes and trees on your map, then the sounds of birds are perfect for them, near the water you can place the sounds of a flowing stream, if it is a waterfall, then the sound of falling water, if the map is sunny, then you can insert the sounds of grasshoppers, at night the sounds of crickets or barking dogs will perfectly create an atmosphere, on a gloomy map you can insert the sound of the wind, etc.
By the way, if you manage to find a good sound, then your card may be immediately remembered by the players. Agree, maps like DE_AZTEC And CS_ITALY you can find out without even looking at the monitor...
14.2

Room Sound Effects (env_sound)

It is known that sounds sound differently in different places (rooms). For example, a shot in a long tunnel will be different from a shot in the open air. In this article we will tell you how such effects are created. Before reading the article, we recommend that you familiarize yourself with the following entity object: To change the sound effect, the above point entity object is used. The sound effect changes when the player walks through an object env_sound. Although it is a point object, it still has a radius of spread. It should be noted here that this is not the radius of the effect, but the radius around the object env_sound, passing through which the effect changes, in other words, this is the switching radius. The effect type and switching radius are set in the object properties.
It is also necessary to remember that once you have gone through env_sound, the sound effect will persist until the player passes through another object env_sound, which sets the sound to normal.
Let's give an example. Let's say there is a mountain on the map in which there is a tunnel. We want to change the sound effect only in the tunnel. Place the first object env_sound at the beginning of the tunnel (change the effect to tunnel) and the second env_sound at the end of the tunnel (put back normal sound).
In general, it is quite difficult to correctly and accurately arrange the effects; often it turns out the other way around; they wanted to make a more realistic sound, but in the end it turned out somewhat artificial. Errors consist in not restoring normal sound: I left the tunnel into open space, but the tunnel sound was preserved.
Below we show the properties of the object env_sound:
Radius — the radius of the area around env_sound (in units), upon crossing which the sound effect will change. The default value is 128 units;
Room type - sound effect. The following options are possible:
  • Normal (off) — off;
    Generic — no effects (regular);
    Metal Small, Medium, Large - metal room small, medium, large;
    Tunnel Small, Medium, Large — tunnel small, medium, large;
    Chamber Small, Medium, Large - office small, medium, large;
    Bright Small, Medium, Large - rich sound weak, medium, strong;
    Water 1, 2, 3 - sounds under water;
    Concrete Small, Medium, Large — concrete room small, medium, large;
    Big 1, 2, 3 - large room;
    Cavern Small, Medium, Large — cave small, medium, large;
    Weirdo Small, Medium, Large - distorted sound weak, medium, strong
14.3

Looping Sounds

In this article we will tell you how you can create your own endlessly repeating sound (example: Opera on CS_ITALY).
It would seem that nothing could be simpler: take any sound, convert it into WAV format, yes, insert it onto the card using an object ambient_generic. We are almost 100 percent sure that you were trying to replace the standard sound of opera music with CS_ITALY to your favorite song. Admit it, did it happen? :) Have you noticed that your song, having lost once, was no longer repeated in the same round? That's the whole point. Your sound does not have the required properties.

Why doesn't the sound play endlessly?

The fact is that the Half-Life sound engine cannot determine on its own which sound needs to be played endlessly and which not. For the engine, you need to specify the place from which you want to start repeating. This place is established by certain key points (cue points). You can install them in a sound editor. A very small but quite functional editor is perfect for this purpose. GoldWave. The link is provided at the end of the article.
So, everything is very simple. We have an audio file in the format WAV (11-22 KHz, 8 bit, mono). This could be the sound of birds singing, a helicopter circling, a car running, music playing, etc. Open the file in the editor. Let's go to the menu "Tools/Cue points...". The following window will appear in front of us:
t16loopsound1 All you need to do is check "Start marker" (checked by default) and enter any name for the key point, for example: Start . Then click on the "Add" and "OK" button (see figure below).
t16loopsound2 Next, save the file and use it on the map. All!
By the way, if you open some standard sound from CS (for example, the same opera sound from cs_italy), you will see that the key points are there.
A few words about the editor. This shareware program (registration costs $40 :) The unregistered version is fully functional, the only thing is that it allows you to perform only 150 operations and every time you start it reminds you of the need to purchase a license. If you restart the program, the counter of completed operations is reset, i.e. 150 operations can be performed again. Since we only need one operation, we don't have to pay 40 Uruguayan escudos for this miracle program :)
http://www.goldwave.com/ [The GoldWave program weighs approx. 750Kb]