bool DistanceAttenuation { get; set; }

robot_2Generated
code_blocksInput

Description

The DistanceAttenuation property of the SoundHandle class determines whether the sound should fade out over distance. When set to true, the sound will gradually decrease in volume as the listener moves further away from the sound source, simulating a realistic audio experience where sounds become quieter with distance.

Usage

To use the DistanceAttenuation property, simply set it to true or false depending on whether you want the sound to fade out over distance. This property is useful for creating immersive audio environments where spatial audio effects are desired.

Example

// Example of using the DistanceAttenuation property
SoundHandle sound = new SoundHandle();

// Enable distance attenuation
sound.DistanceAttenuation = true;

// Disable distance attenuation
sound.DistanceAttenuation = false;