audSet3DSourceAttenuation

Sets the attenuation model and rolloff factor for a 3D audio source. Takes attenuationModel (attenuation model type), channel (channel handle), rolloffFactor (distance attenuation factor). Returns nothing.

Audio

Parameters & Returns

Parameters

attenuationModel Int
channel Int
rolloffFactor Double

Returns

Void

Quick Summary

Sets the attenuation model and rolloff factor for a 3D audio source. Takes attenuationModel (attenuation model type), channel (channel handle), rolloffFactor (distance attenuation factor). Returns nothing.

Technical Exegesis...

Configures how volume decreases with distance for a 3D audio source. The attenuationModel determines the attenuation curve (0=no attenuation, 1=inverse distance, 2=linear distance, 3=exponential distance), and rolloffFactor controls how quickly the volume falls off with distance.

Does nothing if the channel handle is invalid or <= 0. Higher rolloffFactor values make sounds fade out more quickly with distance. Use this to fine-tune how realistic or exaggerated distance-based volume reduction should be.

Example

Example.bam
; Linear attenuation model (2) with rolloff factor 1.0
; Attenuation models: 0=None, 1=Inverse, 2=Linear, 3=Exponential

audSet3DSourceAttenuation(channel, 2, 1.0)