I have some problem with the formula used for sounds spatialization in a framework I use (SFML).
For displaying a sound in 2D, I'm drawing a circle (its radius is the distance where the sound's volume is 100%), and I'm trying to draw a border to this circle according to the volume sound's attenuation. (Circle is green and border is red on the schema).
Here is the forumla used in the framework: $\mathbf{Volume factor = MinDistance / (MinDistance + Attenuation * (max(Distance, MinDistance) - MinDistance))}$
Where:
- MinDistance is the distance where the volume will always be 100%.
- Attenuation is a multiplicative factor used to calculate the volume factor according to the current distance. The greater the attenuation, the less it will be heard when the sound moves away from the listener.
- Distance is the distance between the sound and the listener.
- Volume factor is the calculated factor, in range [0 .. 1], that will be applied to the sound's volume.
So the smallest circle's radius is the given MinDistance, but what about the border's radius ? It needs to end where the volume factor is near 0.1f. I need to know the distance where the volume factor will be ~0.1.
Could someone help me to find the good formula for calculate a "MaxDistance", which would be the distance where the Volume factor is ~0.1, depending on the attenuation and/or the current listener distance from the sound ?
Sorry for my bad english.