Panda3D
Public Member Functions | Public Attributes | Static 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
 

Static Public Attributes

def attach_listener = attachListener
 
def attach_sound_to_object = attachSoundToObject
 
def detach_listener = detachListener
 
def detach_sound = detachSound
 
def get_distance_factor = getDistanceFactor
 
def get_doppler_factor = getDopplerFactor
 
def get_drop_off_factor = getDropOffFactor
 
def get_listener_velocity = getListenerVelocity
 
def get_sound_max_distance = getSoundMaxDistance
 
def get_sound_min_distance = getSoundMinDistance
 
def get_sound_velocity = getSoundVelocity
 
def get_sounds_on_object = getSoundsOnObject
 
def load_sfx = loadSfx
 
def set_distance_factor = setDistanceFactor
 
def set_doppler_factor = setDopplerFactor
 
def set_drop_off_factor = setDropOffFactor
 
def set_listener_velocity = setListenerVelocity
 
def set_listener_velocity_auto = setListenerVelocityAuto
 
def set_sound_max_distance = setSoundMaxDistance
 
def set_sound_min_distance = setSoundMinDistance
 
def set_sound_velocity = setSoundVelocity
 
def set_sound_velocity_auto = setSoundVelocityAuto
 

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.
If the object is deleted, the sound will automatically be removed.

◆ 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

◆ attach_listener

def attach_listener = attachListener
static

◆ attach_sound_to_object

def attach_sound_to_object = attachSoundToObject
static

◆ audio_manager

audio_manager

◆ detach_listener

def detach_listener = detachListener
static

◆ detach_sound

def detach_sound = detachSound
static

◆ get_distance_factor

def get_distance_factor = getDistanceFactor
static

◆ get_doppler_factor

def get_doppler_factor = getDopplerFactor
static

◆ get_drop_off_factor

def get_drop_off_factor = getDropOffFactor
static

◆ get_listener_velocity

def get_listener_velocity = getListenerVelocity
static

◆ get_sound_max_distance

def get_sound_max_distance = getSoundMaxDistance
static

◆ get_sound_min_distance

def get_sound_min_distance = getSoundMinDistance
static

◆ get_sound_velocity

def get_sound_velocity = getSoundVelocity
static

◆ get_sounds_on_object

def get_sounds_on_object = getSoundsOnObject
static

◆ listener_target

listener_target

◆ listener_vel

listener_vel

◆ load_sfx

def load_sfx = loadSfx
static

◆ root

root

◆ set_distance_factor

def set_distance_factor = setDistanceFactor
static

◆ set_doppler_factor

def set_doppler_factor = setDopplerFactor
static

◆ set_drop_off_factor

def set_drop_off_factor = setDropOffFactor
static

◆ set_listener_velocity

def set_listener_velocity = setListenerVelocity
static

◆ set_listener_velocity_auto

def set_listener_velocity_auto = setListenerVelocityAuto
static

◆ set_sound_max_distance

def set_sound_max_distance = setSoundMaxDistance
static

◆ set_sound_min_distance

def set_sound_min_distance = setSoundMinDistance
static

◆ set_sound_velocity

def set_sound_velocity = setSoundVelocity
static

◆ set_sound_velocity_auto

def set_sound_velocity_auto = setSoundVelocityAuto
static

◆ sound_dict

sound_dict

◆ vel_dict

vel_dict