Source:setAbsorption
EditSets 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.
Arguments
| Name | Type | Description |
| low | number | The absorption coefficient for low frequencies (400 Hz). |
| mid | number | The absorption coefficient for midrange frequencies (2.5 kHz). |
| high | number | The absorption coefficient for high frequencies (15 kHz). |
Returns
Nothing
Arguments
| Name | Type | Description |
| enable | boolean |
Whether absorption should be enabled. False will set the coefficients to zero, true will use the absorption coefficients of air (see notes).
|
Returns
Nothing
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.