Audio constants
Revision as of 01:16, 1 May 2013 by RobertBColton (talk | contribs)
These are the new audio constants for the new audio system.
Constant | Description |
---|---|
audio_old_system | the legacy sound system is in use |
audio_new_system | the new sound system is in use |
These constants are for dealing with audio fall off calculation, the formulas are as follows.
Constant | Description |
---|---|
audio_falloff_exponent_distance | gain = (listener_distance / reference_distance) ^ (-falloff_factor) |
audio_falloff_exponent_distance_clamped | distance = clamp(listener_distance, reference_distance, maximum_distance) gain = (distance / reference_distance) ^ (-falloff_factor) |
audio_falloff_inverse_distance | gain = reference_distance / (reference_distance + falloff_factor * (listener_distance – reference_distance)) |
audio_falloff_inverse_distance_clamped | distance = clamp(listener_distance, reference_distance, maximum_distance) gain = reference_distance / (reference_distance + falloff_factor * (distance – reference_distance)) |
audio_falloff_linear_distance | distance = min(distance, maximum_distance) gain = (1 – falloff_factor * (distance – reference_distance) / (maximum_distance – reference_distance)) |
audio_falloff_linear_distance_clamped | distance = clamp(listener_distance, reference_distance, maximum_distance) gain = (1 – falloff_factor * (distance – reference_distance) / (maximum_distance – reference_distance)) |
audio_falloff_none | gain = 1 |