Source:getAbsorption

Edit

Returns the absorption coefficients of the Source. Absorption allows for simulating the decay of audio as it moves through a medium, with different frequencies decaying at different rates. For example, in air, distant sounds usually sound more muffled because higher frequencies decay faster than lower frequencies.

low, mid, high = Source:getAbsorption()

Arguments

None

Returns

NameTypeDescription
lownumber The absorption coefficient for low frequencies (400 Hz).
midnumber The absorption coefficient for midrange frequencies (2.5 kHz).
highnumber The absorption coefficient for high frequencies (15 kHz).

Notes

When a Source is created, its absorption coefficients are all zero (no absorption).

The formula used for the volume factor of each band is math.exp(-absorption * distance).

The absorption coefficients of air are .0002, .0017, and .0182.

See also