Source:getFalloff

Edit

Returns the volume falloff of the Source, which causes it to get quieter as it gets further away from the listener.

minDistance, minVolume = Source:getFalloff()

Arguments

None

Returns

NameTypeDescription
minDistancenumber The distance at which the volume starts to decrease.
minVolumenumber The minimum volume for the falloff. For example, .25 clamps the falloff to 25% of the source's volume. Note that other effects like cone and occlusion can still decrease the volume further. The falloff volume factor gets combined (multiplied) with other volume factors.

Notes

The formula for falloff is:

if distance > minDistance then
  volume = volume * math.max(minVolume, 1 / (1 + distance - minDistance))
end

See also