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 more realistic audio experience.

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 can be useful for creating immersive audio environments where sounds behave naturally as they would in the real world.

Example

// Example of using DistanceAttenuation
SoundHandle sound = new SoundHandle();
sound.DistanceAttenuation = true; // Enable distance attenuation

// Later in the code, you might want to disable it
sound.DistanceAttenuation = false; // Disable distance attenuation