Panda3D
Public Member Functions | Public Attributes

Audio3DManager Class Reference

List of all members.

Public Member Functions

def __init__
def attachListener
def attachSoundToObject
def detachListener
def detachSound
def disable
def getDistanceFactor
def getDopplerFactor
def getDropOffFactor
def getListenerVelocity
def getSoundMaxDistance
def getSoundMinDistance
def getSoundsOnObject
def getSoundVelocity
def loadSfx
def setDistanceFactor
def setDopplerFactor
def setDropOffFactor
def setListenerVelocity
def setListenerVelocityAuto
def setSoundMaxDistance
def setSoundMinDistance
def setSoundVelocity
def setSoundVelocityAuto
def update

Public Attributes

 audio_manager
 listener_target
 listener_vel
 root
 sound_dict
 vel_dict

Constructor & Destructor Documentation

def __init__ (   self,
  audio_manager,
  listener_target = None,
  root = None,
  taskPriority = 51 
)

Member Function Documentation

def attachListener (   self,
  object 
)
Sounds will be heard relative to this object. Should probably be the camera.
def attachSoundToObject (   self,
  sound,
  object 
)
Sound will come from the location of the object it is attached to
def detachListener (   self)
Sounds will be heard relative to the root, probably render.
def detachSound (   self,
  sound 
)
sound will no longer have it's 3D position updated
def disable (   self)
Detaches any existing sounds and removes the update task
def getDistanceFactor (   self)
Control the scale that sets the distance units for 3D spacialized audio.
Default is 1.0 which is adjust in panda to be feet.
def getDopplerFactor (   self)
Control the presence of the Doppler effect. Default is 1.0
Exaggerated Doppler, use >1.0
Diminshed Doppler, use <1.0
def getDropOffFactor (   self)
Exaggerate or diminish the effect of distance on sound. Default is 1.0
Valid range is 0 to 10
Faster drop off, use >1.0
Slower drop off, use <1.0
def getListenerVelocity (   self)
Get the velocity of the listener.
def getSoundMaxDistance (   self,
  sound 
)
Controls the maximum distance (in units) that this sound stops falling off.
The sound does not stop at that point, it just doesn't get any quieter.
You should rarely need to adjust this.
Default is 1000000000.0
def getSoundMinDistance (   self,
  sound 
)
Controls the distance (in units) that this sound begins to fall off.
Also affects the rate it falls off.
Default is 3.28 (in feet, this is 1 meter)
def getSoundsOnObject (   self,
  object 
)
returns a list of sounds attached to an object
def getSoundVelocity (   self,
  sound 
)
Get the velocity of the sound.
def loadSfx (   self,
  name 
)
Use Audio3DManager.loadSfx to load a sound with 3D positioning enabled
def setDistanceFactor (   self,
  factor 
)
Control the scale that sets the distance units for 3D spacialized audio.
Default is 1.0 which is adjust in panda to be feet.
When you change this, don't forget that this effects the scale of setSoundMinDistance
def setDopplerFactor (   self,
  factor 
)
Control the presence of the Doppler effect. Default is 1.0
Exaggerated Doppler, use >1.0
Diminshed Doppler, use <1.0
def setDropOffFactor (   self,
  factor 
)
Exaggerate or diminish the effect of distance on sound. Default is 1.0
Valid range is 0 to 10
Faster drop off, use >1.0
Slower drop off, use <1.0
def setListenerVelocity (   self,
  velocity 
)
Set the velocity vector (in units/sec) of the listener, for calculating doppler shift.
This is relative to the sound root (probably render).
Default: VBase3(0, 0, 0)
def setListenerVelocityAuto (   self)
If velocity is set to auto, the velocity will be determined by the
previous position of the object the listener is attached to and the frame dt.
Make sure if you use this method that you remember to clear the previous
transformation between frames.
def setSoundMaxDistance (   self,
  sound,
  dist 
)
Controls the maximum distance (in units) that this sound stops falling off.
The sound does not stop at that point, it just doesn't get any quieter.
You should rarely need to adjust this.
Default is 1000000000.0
def setSoundMinDistance (   self,
  sound,
  dist 
)
Controls the distance (in units) that this sound begins to fall off.
Also affects the rate it falls off.
Default is 3.28 (in feet, this is 1 meter)
Don't forget to change this when you change the DistanceFactor
def setSoundVelocity (   self,
  sound,
  velocity 
)
Set the velocity vector (in units/sec) of the sound, for calculating doppler shift.
This is relative to the sound root (probably render).
Default: VBase3(0, 0, 0)
def setSoundVelocityAuto (   self,
  sound 
)
If velocity is set to auto, the velocity will be determined by the
previous position of the object the sound is attached to and the frame dt.
Make sure if you use this method that you remember to clear the previous
transformation between frames.
def update (   self,
  task = None 
)
Updates position of sounds in the 3D audio system. Will be called automatically
in a task.

Member Data Documentation

 All Classes Namespaces Functions Variables Properties