GetDistGainFromSoundLevel

Last Updated2011-09-03
Created At2011-09-03

Calculates gain of sound on given distance with given sound level in decibel

native float GetDistGainFromSoundLevel(int soundlevel, float distance)

Parameters

int soundlevel
decibel of sound, like SNDLEVEL_NORMAL or integer value
float distance
distance of sound to calculate, not meter or feet, but Source Engine`s normal Coordinate unit

Return Value

float gain of sound. you can multiply this with original sound`s volume to calculate volume on given distance