Welcome to the second part of our sound-focused tutorials. This time, we’ll learn to use sound emitters, which are single sound sources. Remember that any sound set using sound emitters will play as mono sounds, in 3D To show their function, we’ll add a few sounds coming from behind closed doors. To do that, we’ll select a Sound Emitter object from the Assets window, and place it on a map. The sound will come exactly from the spot the Sound Emitter is placed in, so it’s important to position it carefully. The sound we want to use is child’s crying. In the attributes window, in sSoundName we have a list of all available sounds. Let’s find ‘screamer crying’ Now we’ll modify some basic parameters of our Sound Emitter. In the ‘Sound Range’ field we’ll set the range at which you’ll hear the sound.
We can use presets, but this time we’ll choose ‘none’ to set it manually. Min/Max Distance fields will be used for this. The Min range defines when the sound will start fading, until it fades completely at Max range. The ranges are visualized by spheres, for ease of use. We want the sound to be audible from a large distance, so it draws player’s attention. Let’s set Min to 1 and Max to 8. Another important field is Type of Occlusion. We use to set if we want our sound to be diminished by obstructive objects between the Emitter and the Player.
We want our emitter to only work with distance, not objects, so we choose ‘distance’ Finally, we magnify the volume of our sound by inputting 1,5 in fVolume field If you give too high of a value to to fVolume, you’ll break a threshold that will cause this sound to entirely take over other sound on the maps, so don’t overdo it. To check what our Emitter sounds like, you can play it by selecting the Test flag in the editor. We managed to place a single sound, but to further add to the atmosphere, we’ll add another emitter with random zombie screams from behind the door. First, copy our initial Sound Emitter. This time, we change its class in the Attributes window from SoundEmitterSimple to SoundEmitterRandom This will allow us to randomly play sounds from a predefined pool.
Let’s modify the parameters – most of them are exactly the same across both types of emitters. This time, we want the sound to be audible in a smaller radius, and be diminished by both distance and obstructions. Let’s set MinDistance 1, MaxDistance 4 and occlusion type to ‘full’ In aSounds field we select the pool of sounds for this emitter. Let’s select ‘zombie behind door’ and select fitting sounds while holding down ‘ctrl’ Sound will be played in a random order, with random interval limited by Min and Max TimeBetweenSounds with values in seconds. Let’s input Min 4 and Max 7 seconds. We don’t want the screams to drown out the child’s crying – in fVolume we’ll input Let’s check how it sounds in-game. Both sound emitters work now, so we’re ready to go to the next part in the tutorial series..
As found on Youtube