This tutorial explains how to setup the SDL Mixer for Sounds that are emitting from or around a given spot in a Level.
CRYENGINE uses the AudioTriggerSpot Entity to execute ATL-Triggers that are emitting Sound from or around a given spot in a Level. These Sounds are called SpotFX.
The SDL-Mixer has a basic set of options that are used to specify how the Sound will be played back in the ENGINE.
The AudioTriggerSpot can be found in the RollupBar under Objects/Audio. After selecting the AudioTriggerSpot Entity you can place it anywhere in a Level.
For a detailed explanation on how to correctly setup the AudioTriggerSpot Entity in your Level follow the Instructions found here.
Through the SDL-Mixer you can enable a simple set of 3D properties for each Sound connected to an ATL-Trigger.
These can be accessed in the Inspector by clicking on the ATL-Trigger and then selecting the connected Audio file.
The Enable Panning option, positions the Sound according to the angle between the listener and the Sound source.
Note: The Enable Panning checkbox should always be enabled when placing a Sound in a Level so that a localization of the Sound source is possible.
The Enable Distance Attenuation option linearly attenuates the volume of the Sound (depending on the distance values used) and will create fitting attenuation values. This option should be enabled when placing a Sound in a Level as a SpotFX.
Use the Min Distance: and Max Distance: to define when a Sound will start to attenuate and when it will be fully attenuated. For example, with a Min Distance of 10 and a Max Distance of 30 the Sound will play on full volume during the first 10 meters of moving away from the Sound source and then start to drop off in volume until it will be fully attenuated (silent) at a distance of 30 meters.
If you want to re-trigger a Sound over a certain time frame then you can make use of the randomization feature of the AudioTriggerSpot.
This can be useful for adding more variation and interest to the Sound scape in your Level. For example, this can be used to simulate seagulls which can be heard at different points in time and in different positions in the sky.
You have now learned how to setup the SDL-Mixer for SpotFX Sounds to make them play correctly inside CRYENGINE.
Next, learn how to create a setup for Ambiences and the SDL-Mixer.