Panda3D Manual: 3D AudioA wrapper from direct.showbase import Audio3DManager To create a sound that is positional, you need to use the mySound = audio3d.loadSfx('blue.wav') Sounds can be attached to objects such that when they move, the sound source will move along with them. audio3d.attachSoundToObject(mySound, teapot) You can use the audio3d.setSoundVelocity(sound,velocityVector) Currently, for the latter to work, a CollisionTraverser must be attached to base.cTrav as you see in the example. If you already have one assigned to do collision detection that will be sufficient. Read more about Collision Traversers. The attenuation of moving sounds by distance and the doppler shift are based the way sound works in the real world. By default it assumes a scale of 1 panda unit equal to 1 foot. If you use another scale you'll need to use audio3d.setDistanceFactor(scale) You can adjust the rate that sounds attenuate by distance. If you want to position the sounds but don't want the volume to be effected by their distance, you can set the drop off factor to 0. audio3d.setDropOffFactor(scale) © Carnegie Mellon University 2010 |