direct.showbase.Audio3DManager

from direct.showbase.Audio3DManager import Audio3DManager

Contains the Audio3DManager class.

Inheritance diagram

Inheritance diagram of direct.showbase.Audio3DManager

class Audio3DManager(audio_manager, listener_target=None, root=None, taskPriority=51)[source]

Bases: object

__init__(self, audio_manager, listener_target=None, root=None, taskPriority=51)[source]
attachListener(self, object)[source]

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

attachSoundToObject(self, sound, object)[source]

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(self)[source]

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

detachSound(self, sound)[source]

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

disable(self)[source]

Detaches any existing sounds and removes the update task

getDistanceFactor(self)[source]

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(self)[source]

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

getDropOffFactor(self)[source]

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(self)[source]

Get the velocity of the listener.

getSoundMaxDistance(self, sound)[source]

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(self, sound)[source]

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)

getSoundVelocity(self, sound)[source]

Get the velocity of the sound.

getSoundsOnObject(self, object)[source]

returns a list of sounds attached to an object

loadSfx(self, name)[source]

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

setDistanceFactor(self, factor)[source]

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(self, factor)[source]

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

setDropOffFactor(self, factor)[source]

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(self, velocity)[source]

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(self)[source]

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(self, sound, dist)[source]

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(self, sound, dist)[source]

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(self, sound, velocity)[source]

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(self, sound)[source]

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(self, task=None)[source]

Updates position of sounds in the 3D audio system. Will be called automatically in a task.