The sound system is responsible for playing effects and music sounds in-game and in Sapien.
Like the renderer's texture cache, the sound system also holds sound data in an in-memory sound cache. When a sound must be played that is not in this cache, it will be loaded from a map cache file (possibly a shared resource map) or the tags directory depending on the build of the engine. The cache can hold a maximum of 512 entries or 64 MB.
The predicted resources block seen in some tag classes are meant to give the engine a hint about what sounds (and textures) should be cached.
MCC and Custom Edition (when using EAX emulation with DSOAL) apply positional and environmental effects to sounds. For this reason, it is important that level artists ensure BSP clusters have an appropriate sound_
Sounds which are playing behind an obstruction are muffled. An obstruction is anything which blocks a collision ray test between the sound source and the camera. This may be the BSP or an object with collision geometry.
The engine has the following channel limits:
- 26 mono 3D channels
- 4 mono channels
- 4 stereo channels
- 4 44k stereo channels
Related script functions and globals
The following are related functions that you can use in your scenario scripts and/or debug globals that you can enter into the developer console for troubleshooting.
Displays active sound_
Sound sources will be labeled in 3D with their tag path and a their minimum and maximum distances shown as red and yellow spheres, respectively.
If enabled, sound cache statistics will be shown in the top left corner of the screen, including how full it is.
Shows a graph of sound cache slots at the top of the screen, similar to
Displays the utilization of sound channel limits in the top left corner of the screen.
Displays two columns of number pairs while sounds play with an unknown meaning.
If enabled, shows the tag path of the cluster's current sound_
Sets the gain of the hit sound heard when damage is dealt in multiplayer. Defaults to
Writes the sound cache information from
Controls how "muffled" sounds are when heard behind an obstruction like the BSP or an object with collision geometry. Defaults to