Hey all,
I am just wondering if someone could post a minimalistic (but ready-to-run) python file/code that demonstrates 3D positional Audio via OpenAL. -I Can’t seem to get this working.
I have read over both the manual and the forums, as well as external examples I could find on different websites trying every different implementation of the audio setup I could find, and in all of them, the ‘3D’ sound plays, but it is not directional, it simply maintains it’s volume no matter how close the listener object is.
I would really appreciate it if someone could chuck together a simple python file that plays one 3D sound on their computer, and post the code here. This way I can check if it is a problem with my Audio drivers (I do use a wierd legacy sound card) or if it is something I’m doing wrong in code.
Just in case no-one can put together a file like I’ve requested, here’s one version of the audio code I have used (to no avail).
# I have tried attaching it to base.camera, camera, my player object...
audio3d = Audio3DManager.Audio3DManager(base.sfxManagerList[0], camera)
audio3d.setDropOffFactor(.07)
mySound1 = audio3d.loadSfx("sound/drone.wav")
mySound1.setLoop(True)
#mySound1.setVolume(0.5)
#self.mySound1.setBalance(1.0)
#self.mySound1.setPlayRate(1.0)
# I have been attaching it to a point light node point,
# replaced here with object for simplicity
audio3d.attachSoundToObject(mySound1, self.object)
mySound1.play()
I have, in the past gotten OpenAL demo’s to work under C… So i’m pretty annoyed at not being able to get it working under python, which I enjoy using a LOT more than C.
Thanks