ikework
asked on
Calculate Volume at Listener's Position for a 3D-Sound
Hey there,
I'm about to implement 3D-sounds for our game engine. Getting the panning right was quite simple. I'm struggling on finding a more/less accurate formula on how to calculate the volume in respect to the distance to a sound-emitter. I guess its not linear, is it?
I've already tried to google and to look at the OpenAL sources, not much luck so far.
For the sake of simplicity, our emitters emit the sound in 360 degrees, so the emitter has no direction.
Thanks in advance
ike
I'm about to implement 3D-sounds for our game engine. Getting the panning right was quite simple. I'm struggling on finding a more/less accurate formula on how to calculate the volume in respect to the distance to a sound-emitter. I guess its not linear, is it?
I've already tried to google and to look at the OpenAL sources, not much luck so far.
For the sake of simplicity, our emitters emit the sound in 360 degrees, so the emitter has no direction.
Thanks in advance
ike
ASKER
thx ozo .. our underlying sound-system can have values from 0..1024 for the volume.
the docs say:
"1024 is the original value, volume scale is between 0 and 1024 with 960 being a -6db drop"
so what i understand from your post is something like this:
volume = 1024 - (sqrt(distance)*scale)
if scale == 6.4f we had a drop of -6dB at 100 units distance
you think that would be ok?
the docs say:
"1024 is the original value, volume scale is between 0 and 1024 with 960 being a -6db drop"
so what i understand from your post is something like this:
volume = 1024 - (sqrt(distance)*scale)
if scale == 6.4f we had a drop of -6dB at 100 units distance
you think that would be ok?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
great, i see
ASKER
In case, anybody else has this problem too, this link was very useful to me, basically the same as ozo said. you can plugin values in a calculator and test your own values.
http://www.sengpielaudio.com/calculator-distance.htm
Thanks ozo :)
http://www.sengpielaudio.com/calculator-distance.htm
Thanks ozo :)
But perceived intensity is approximately logarithmic, so doubling the distance drops the intensity by about 6 dB and 10 times the distance drops the intensity by 20 dB.