If you are looking for eye-candy, you are wrong here. I have been digging through some of my files and found an experiment related to 3D sound in the BGE I want to share. Think of the delay between lightning and thunder introduced by the difference in speed of light and sound. There is also a little siren demo, showing shifted frequency of an amulbance sound while moving.
I think the BGEs actuators don’t do the delay by default. Here we go:
BGE_SoundWave_v2.blend (1012.2 KB)
What it does:
- on Keys 1,2,3 short soundfiles (gunshots) in different distances at the camera are triggered. An animated sphere shall show the travelling wave. You can observe different delays and different loudness.
- on Key Left and Right, an ambulance siren moves around. You can observe frequency shift, varying loudness and direction.
It should work for moving emitters and listeners as well, as the math is basically just a distance check between two moving points. Maybe this is useful for somebody here.
- I am aware that the speed of sound is not physically correct in there - it’s just a demo.
- Sound files are from freesound.org if I remember correctly.