Sound
Usage
Speakers emit sound from their origin, and pan around the user's speakers as they turn their character and move around inside the map environment. Sounds can be either called from within code, or by being placed as a speaker at a specific location inside a map.
Sounds themselves are defined within sound shader files. ETQW uses a number of files containing many sound shaders in each. For example, 'ambience.sndshd' contains a list of sound shaders for environmental and ambient sounds. Sound shaders define how a sound is played and allow a single sound to be constructed from a number of .wav files.
Map Usage
A speaker entity should be placed at all sound sources within the map. In some cases - such as forests or sea shore - it is necessary to create a number of sound entities along the length and breadth of the area in order to ensure the sound is present within (or along) the entire area.
- See speaker for information on how to use this entity
Creating Sounds
Sounds consist of two elements:
- A .wav file of the sound itself
- A .sndshd sound shader declaration, referencing the .wav file
Sounds are then referred to by the name given to them in their shader declaration.
Example
Sound shaders are typically set up using editSounds.
A sound shader declaration can be as simple as this:
sound ambience/outdoors/quacking { sounds/ambience/outdoors/water_creatures/ducks_quacking.wav }
The sound could then be referred to by the name ambience/outdoors/quacking from both speakers and coded events.
Reference
Royalty-free sounds can be sourced from a number of places.