Audio constants: Difference between revisions

From ENIGMA
Jump to navigation Jump to search
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
These are the new audio constants for the new audio system.
These are the new audio constants for the new audio system.
 
{| class="consttab" width=""
{| cellpadding=25 cellspacing=0 border=0 align=left style="width:100%;"
|-  
|
! '''Constant''' !! '''Description'''
{| class="wikitable" cellpadding=5 cellspacing=0 border=0 style="background-color:#FAD796; border: 2px; border-style: solid; border-color:gray;"
|- cellpadding=5 cellspacing=0 border=0 style="background-color:black; color:white;"
| '''Constant'''  
| '''Description'''
|-
|-
|'''audio_old_system'''
| audio_old_system
|the legacy sound system is in use
|the legacy sound system is in use
|-
|-
|'''audio_new_system'''
| audio_new_system  
|the new sound system is in use
|the new sound system is in use
|}
|}


These constants are for dealing with audio fall off calculation, the formulas are as follows.
{| class="consttab" width=""
|-
! '''Constant''' !! '''Description'''
|-
|-
|
| audio_falloff_exponent_distance  
 
{| class="wikitable" cellpadding=5 cellspacing=0 border=0 style="background-color:#FAD796; border: 2px; border-style: solid; border-color:gray;"
|- cellpadding=5 cellspacing=0 border=0 style="background-color:black; color:white;"
| '''Constant'''
| '''Description'''
|-
|'''audio_falloff_exponent_distance'''
|gain = (listener_distance / reference_distance) ^ (-falloff_factor)
|gain = (listener_distance / reference_distance) ^ (-falloff_factor)
|-
|-
|'''audio_falloff_exponent_distance_clamped'''
| audio_falloff_exponent_distance_clamped
|distance = clamp(listener_distance, reference_distance, maximum_distance)<br>
|distance = clamp(listener_distance, reference_distance, maximum_distance)<br>
gain = (distance / reference_distance) ^ (-falloff_factor)
gain = (distance / reference_distance) ^ (-falloff_factor)
|-
|-
|'''audio_falloff_inverse_distance'''
| audio_falloff_inverse_distance
|gain = reference_distance / (reference_distance + falloff_factor * (listener_distance – reference_distance))
|gain = reference_distance / (reference_distance + falloff_factor * (listener_distance – reference_distance))
|-
|-
|'''audio_falloff_inverse_distance_clamped'''
| audio_falloff_inverse_distance_clamped
|distance = clamp(listener_distance, reference_distance, maximum_distance) <br>
|distance = clamp(listener_distance, reference_distance, maximum_distance) <br>
gain = reference_distance / (reference_distance + falloff_factor * (distance – reference_distance))
gain = reference_distance / (reference_distance + falloff_factor * (distance – reference_distance))
|-
|-
|'''audio_falloff_linear_distance'''
| audio_falloff_linear_distance
|distance = min(distance, maximum_distance) <br>
|distance = min(distance, maximum_distance) <br>
gain = (1 – falloff_factor * (distance – reference_distance) / (maximum_distance – reference_distance))
gain = (1 – falloff_factor * (distance – reference_distance) / (maximum_distance – reference_distance))
|-
|-
|'''audio_falloff_linear_distance_clamped'''
| audio_falloff_linear_distance_clamped
|distance = clamp(listener_distance, reference_distance, maximum_distance) <br>
|distance = clamp(listener_distance, reference_distance, maximum_distance) <br>
gain = (1 – falloff_factor * (distance – reference_distance) / (maximum_distance – reference_distance))
gain = (1 – falloff_factor * (distance – reference_distance) / (maximum_distance – reference_distance))
|-
|-
|'''audio_falloff_none'''
| audio_falloff_none
|gain = 1
|gain = 1
|}
|}


These are legacy constants for use with DirectSound effects, they are deprecated and are only available for compatibility.
{| class="consttab" width=""
|-
! '''Constant''' !! '''Description'''
|-
| se_none || No sound effect.
|-
| se_chorus || Chorus sound effect.
|-
| se_echo || Echo sound effect.
|-
| se_flanger || Flanger sound effect.
|-
| se_gargle || Gargle sound effect.
|-
| se_reverb || Reverb sound effect.
|-
| se_compressor || Compressor sound effect.
|-
| se_equalizer || Equalizer sound effect.
|}
|}

Latest revision as of 19:30, 17 September 2013

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

These are legacy constants for use with DirectSound effects, they are deprecated and are only available for compatibility.

Constant Description
se_none No sound effect.
se_chorus Chorus sound effect.
se_echo Echo sound effect.
se_flanger Flanger sound effect.
se_gargle Gargle sound effect.
se_reverb Reverb sound effect.
se_compressor Compressor sound effect.
se_equalizer Equalizer sound effect.