I am trying to put 3Dish audio in a game I'm developing, and I'm unsure how to do positional sound. I want to be able to adjust the volume of the audio's channels depending on how far it is and the orientation.
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
|
Since you didn't mention any API for sound I'll give you the general answer. First get the distance between the audio listener and the audio source Then you define a distance where you don't want it to be audible anymore, lets say 150m If your distance is 40 meters from the source, then the volume is about 73%. To give you an equation that would be: That's assuming you want the volume to change linearly with your position change. |
|||||||||||||||
|