AudioListener3D
Inherits: Spatial3D < Actor < Object
Overrides the location sounds are heard from.
Description
Section titled “Description”Once added to the scene tree and enabled using make_current(), this actor will override the location sounds are heard from. This can be used to listen from a location different from the Camera3D.
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| AudioListener3D.DopplerTracking | doppler_tracking | 0 |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| void | clear_current() |
| Transform3D | get_listener_transform() |
| bool | is_current() |
| void | make_current() |
Enumerations and constants
Section titled “Enumerations and constants”enum DopplerTracking
Section titled “enum DopplerTracking”- DOPPLER_TRACKING_DISABLED =
0— Disables Doppler effect simulation (default).
- DOPPLER_TRACKING_IDLE_STEP =
1— Simulate Doppler effect by tracking positions of objects that are changed in_process. Changes in the relative velocity of this listener compared to those objects affect how audio is perceived (changing the audio’sAudioStreamPlayer3D.pitch_scale).
- DOPPLER_TRACKING_PHYSICS_STEP =
2— Simulate Doppler effect by tracking positions of objects that are changed in_physics_process. Changes in the relative velocity of this listener compared to those objects affect how audio is perceived (changing the audio’sAudioStreamPlayer3D.pitch_scale).
Property descriptions
Section titled “Property descriptions”doppler_tracking
Section titled “doppler_tracking”AudioListener3D.DopplerTracking doppler_tracking = 0
Setter/getter: set_doppler_tracking(), get_doppler_tracking()
If not DOPPLER_TRACKING_DISABLED, this listener will simulate the Doppler effect for objects changed in particular _process methods.
Note: The Doppler effect will only be heard on AudioStreamPlayer3Ds if AudioStreamPlayer3D.doppler_tracking is not set to AudioStreamPlayer3D.DOPPLER_TRACKING_DISABLED.
Method descriptions
Section titled “Method descriptions”clear_current
Section titled “clear_current”void clear_current()
Disables the listener to use the current camera’s listener instead.
get_listener_transform
Section titled “get_listener_transform”Transform3D get_listener_transform() const
Returns the listener’s global orthonormalized Transform3D.
is_current
Section titled “is_current”bool is_current() const
Returns true if the listener was made current using make_current(), false otherwise.
Note: There may be more than one AudioListener3D marked as “current” in the scene tree, but only the one that was made current last will be used.
make_current
Section titled “make_current”void make_current()
Enables the listener. This will override the current camera’s listener.