Audio.DistanceAttenuation.rolloff(factor:)
A standard geometric model for attenuating audio intensity naturally with distance, using a specified loss strength factor.
Declaration
case rolloff(factor: Double)Parameters
- factor:
The attenuation model’s loss strength factor in the range of
[0, Double.infinity].
Discussion
The case’s default value is 1.0, which attenuates spatial audio as the listener moves away from the source, similar to real-world physics. You can increase or decrease this effect by changing factor to other values. For example:
0.5reduces the effect by 50%2.0doubles the effect0.0completely disables attenuation