I can't seem to get 3D sound working with audaspace. It works fine when using the logic brick, but I'd like to use python directly if possible.
I'd like to have positional sound relative to the player
object:
import bge
import aud
sound = aud.Factory.file(bge.logic.expandPath('//laserfire01_mono.wav'))
scene = bge.logic.getCurrentScene()
def main(cont):
own = cont.owner
sound_device = aud.device()
sound_device.distance_model = aud.AUD_DISTANCE_MODEL_LINEAR
sound_device.listener_location = scene.objects["player"].worldPosition
sound_device.listener_orientation = (0,0,0,0)
sound_handle = sound_device.play(sound)
sound_handle.location = own.worldPosition
sound_handle.distance_maximum = 12
sound_handle.distance_reference = 1
sound_handle.attenuation = 12
There are no error messages, but the sound is still "2D"; there's no falloff or doppler shift.
Here's a simple test .blend and sound file.