Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Audio3DManager Class Reference

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

## Public Attributes
| audio_manager = audio_manager
| listener_target = listener_target
| listener_vel = VBase3(0, 0, 0)
| root = render
dict | sound_dict = {}
| update
dict | vel_dict = {}

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

## Constructor & Destructor Documentation

## ◆ __init__()

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

## Member Function Documentation

## ◆ attachListener()

attachListener | ( |  | self,
|  |  | object )

    Sounds will be heard relative to this object. Should probably be the camera.

## ◆ attachSoundToObject()

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()

detachListener | ( |  | self | ) |

    Sounds will be heard relative to the root, probably render.

## ◆ detachSound()

detachSound | ( |  | self,
|  |  | sound )

    sound will no longer have it's 3D position updated

## ◆ disable()

disable | ( |  | self | ) |

    Detaches any existing sounds and removes the update task

## ◆ getDistanceFactor()

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 meters.

## ◆ getDopplerFactor()

getDopplerFactor | ( |  | self | ) |

    Control the presence of the Doppler effect. Default is 1.0
    Exaggerated Doppler, use >1.0
    Diminshed Doppler, use <1.0

## ◆ getDropOffFactor()

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()

getListenerVelocity | ( |  | self | ) |

    Get the velocity of the listener.

## ◆ getSoundMaxDistance()

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()

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()

getSoundsOnObject | ( |  | self,
|  |  | object )

    returns a list of sounds attached to an object

## ◆ getSoundVelocity()

getSoundVelocity | ( |  | self,
|  |  | sound )

    Get the velocity of the sound.

## ◆ loadSfx()

loadSfx | ( |  | self,
|  |  | name )

    Use Audio3DManager.loadSfx to load a sound with 3D positioning enabled

## ◆ setDistanceFactor()

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 meters.
    When you change this, don't forget that this effects the scale of setSoundMinDistance

## ◆ setDopplerFactor()

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()

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()

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()

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()

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()

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()

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()

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()

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

attach_listener = attachListener
| static

## ◆ attach_sound_to_object

attach_sound_to_object = attachSoundToObject
| static

## ◆ audio_manager

audio_manager = audio_manager

## ◆ detach_listener

detach_listener = detachListener
| static

## ◆ detach_sound

detach_sound = detachSound
| static

## ◆ get_distance_factor

get_distance_factor = getDistanceFactor
| static

## ◆ get_doppler_factor

get_doppler_factor = getDopplerFactor
| static

## ◆ get_drop_off_factor

get_drop_off_factor = getDropOffFactor
| static

## ◆ get_listener_velocity

get_listener_velocity = getListenerVelocity
| static

## ◆ get_sound_max_distance

get_sound_max_distance = getSoundMaxDistance
| static

## ◆ get_sound_min_distance

get_sound_min_distance = getSoundMinDistance
| static

## ◆ get_sound_velocity

get_sound_velocity = getSoundVelocity
| static

## ◆ get_sounds_on_object

get_sounds_on_object = getSoundsOnObject
| static

## ◆ listener_target

listener_target = listener_target

## ◆ listener_vel

listener_vel = VBase3(0, 0, 0)

## ◆ load_sfx

load_sfx = loadSfx
| static

## ◆ root

root = render

## ◆ set_distance_factor

set_distance_factor = setDistanceFactor
| static

## ◆ set_doppler_factor

set_doppler_factor = setDopplerFactor
| static

## ◆ set_drop_off_factor

set_drop_off_factor = setDropOffFactor
| static

## ◆ set_listener_velocity

set_listener_velocity = setListenerVelocity
| static

## ◆ set_listener_velocity_auto

set_listener_velocity_auto = setListenerVelocityAuto
| static

## ◆ set_sound_max_distance

set_sound_max_distance = setSoundMaxDistance
| static

## ◆ set_sound_min_distance

set_sound_min_distance = setSoundMinDistance
| static

## ◆ set_sound_velocity

set_sound_velocity = setSoundVelocity
| static

## ◆ set_sound_velocity_auto

set_sound_velocity_auto = setSoundVelocityAuto
| static

## ◆ sound_dict

dict sound_dict = {}

## ◆ update

update

## ◆ vel_dict

dict vel_dict = {}