GetDistGainFromSoundLevel Function

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

float GetDistGainFromSoundLevel(int soundlevel, float distance)


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

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