Description
The AirAbsorption
property of the SoundEvent
class determines whether the sound is subject to air absorption effects. When enabled, the sound will be absorbed by the air, which can affect how it is perceived over distance. This property is useful for simulating realistic audio environments where sound diminishes as it travels through the air.
Usage
To use the AirAbsorption
property, you can set it to true
or false
depending on whether you want the sound to be affected by air absorption. This property is typically used in conjunction with other sound properties to create a more immersive audio experience.
Example
// Example of setting the AirAbsorption property
SoundEvent mySoundEvent = new SoundEvent();
mySoundEvent.AirAbsorption = true; // Enable air absorption for this sound event
// Further configuration of the sound event
mySoundEvent.Volume = new RangedFloat(0.5f, 1.0f);
mySoundEvent.Pitch = new RangedFloat(0.8f, 1.2f);
// Add sound files to the event
mySoundEvent.Sounds.Add(new SoundFile("path/to/sound1.wav"));
mySoundEvent.Sounds.Add(new SoundFile("path/to/sound2.wav"));