Panda3D
Public Member Functions | Public Attributes | List of all members
Audio3DManager Class Reference

Public Member Functions

def __init__ (self, audio_manager, listener_target=None, root=None, taskPriority=51)
 
def attachListener (self, object)
 
def attachSoundToObject (self, sound, object)
 
def detachListener (self)
 
def detachSound (self, sound)
 
def disable (self)
 
def getDistanceFactor (self)
 
def getDopplerFactor (self)
 
def getDropOffFactor (self)
 
def getListenerVelocity (self)
 
def getSoundMaxDistance (self, sound)
 
def getSoundMinDistance (self, sound)
 
def getSoundsOnObject (self, object)
 
def getSoundVelocity (self, sound)
 
def loadSfx (self, name)
 
def setDistanceFactor (self, factor)
 
def setDopplerFactor (self, factor)
 
def setDropOffFactor (self, factor)
 
def setListenerVelocity (self, velocity)
 
def setListenerVelocityAuto (self)
 
def setSoundMaxDistance (self, sound, dist)
 
def setSoundMinDistance (self, sound, dist)
 
def setSoundVelocity (self, sound, velocity)
 
def setSoundVelocityAuto (self, sound)
 
def update (self, task=None)
 

Public Attributes

 audio_manager
 
 listener_target
 
 listener_vel
 
 root
 
 sound_dict
 
 vel_dict
 

Constructor & Destructor Documentation

◆ __init__()

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

Member Function Documentation

◆ attachListener()

def attachListener (   self,
  object 
)
Sounds will be heard relative to this object. Should probably be the camera.

◆ attachSoundToObject()

def attachSoundToObject (   self,
  sound,
  object 
)
Sound will come from the location of the object it is attached to

◆ detachListener()

def detachListener (   self)
Sounds will be heard relative to the root, probably render.

◆ detachSound()

def detachSound (   self,
  sound 
)
sound will no longer have it's 3D position updated

◆ disable()

def disable (   self)
Detaches any existing sounds and removes the update task

◆ getDistanceFactor()

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.

◆ getDopplerFactor()

def getDopplerFactor (   self)
Control the presence of the Doppler effect. Default is 1.0
Exaggerated Doppler, use >1.0
Diminshed Doppler, use <1.0

◆ getDropOffFactor()

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

◆ getListenerVelocity()

def getListenerVelocity (   self)
Get the velocity of the listener.

◆ getSoundMaxDistance()

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

◆ getSoundMinDistance()

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)

◆ getSoundsOnObject()

def getSoundsOnObject (   self,
  object 
)
returns a list of sounds attached to an object

◆ getSoundVelocity()

def getSoundVelocity (   self,
  sound 
)
Get the velocity of the sound.

◆ loadSfx()

def loadSfx (   self,
  name 
)
Use Audio3DManager.loadSfx to load a sound with 3D positioning enabled

◆ setDistanceFactor()

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

◆ setDopplerFactor()

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

◆ setDropOffFactor()

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

◆ setListenerVelocity()

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)

◆ setListenerVelocityAuto()

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.

◆ setSoundMaxDistance()

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

◆ setSoundMinDistance()

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

◆ setSoundVelocity()

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)

◆ setSoundVelocityAuto()

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.

◆ update()

def update (   self,
  task = None 
)
Updates position of sounds in the 3D audio system. Will be called automatically
in a task.

Member Data Documentation

◆ audio_manager

audio_manager

◆ listener_target

listener_target

◆ listener_vel

listener_vel

◆ root

root

◆ sound_dict

sound_dict

◆ vel_dict

vel_dict