Struct AudioStreamPlayer3D

Plays 3D sound in 3D space.

struct AudioStreamPlayer3D ;

Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space.

Properties

NameTypeDescription
areaMask[get, set] longAreas in which this sound plays.
attenuationFilterCutoffHz[get, set] doubleDampens audio above this frequency, in Hz.
attenuationFilterDb[get, set] doubleAmount how much the filter affects the loudness, in dB.
attenuationModel[get, set] AudioStreamPlayer3D.AttenuationModelDecides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
autoplay[get, set] boolIf true, audio plays when added to scene tree.
bus[get, set] StringBus on which this audio is playing.
dopplerTracking[get, set] AudioStreamPlayer3D.DopplerTrackingDecides in which step the Doppler effect should be calculated.
emissionAngleDegrees[get, set] doubleThe angle in which the audio reaches cameras undampened.
emissionAngleEnabled[get, set] boolIf true, the audio should be dampened according to the direction of the sound.
emissionAngleFilterAttenuationDb[get, set] doubleDampens audio if camera is outside of emissionAngleDegrees and emissionAngleEnabled is set by this factor, in dB.
maxDb[get, set] doubleSets the absolute maximum of the soundlevel, in dB.
maxDistance[get, set] doubleSets the distance from which the outOfRangeMode takes effect. Has no effect if set to 0.
outOfRangeMode[get, set] AudioStreamPlayer3D.OutOfRangeModeDecides if audio should pause when source is outside of maxDistance range.
pitchScale[get, set] doubleChanges the pitch and the tempo of the audio.
playing[get, set] boolIf true, audio is playing.
stream[get, set] AudioStreamThe AudioStream object to be played.
streamPaused[get, set] boolIf true, the playback is paused. You can resume it by setting stream_paused to false.
unitDb[get, set] doubleBase sound level unaffected by dampening, in dB.
unitSize[get, set] doubleFactor for the attenuation effect.

Methods

NameDescription
_busLayoutChanged
_isActive
_setPlaying
getAreaMask
getAttenuationFilterCutoffHz
getAttenuationFilterDb
getAttenuationModel
getBus
getDopplerTracking
getEmissionAngle
getEmissionAngleFilterAttenuationDb
getMaxDb
getMaxDistance
getOutOfRangeMode
getPitchScale
getPlaybackPosition Returns the position in the AudioStream.
getStream
getStreamPaused
getStreamPlayback Returns the AudioStreamPlayback object associated with this AudioStreamPlayer3D.
getUnitDb
getUnitSize
isAutoplayEnabled
isEmissionAngleEnabled
isPlaying
play Plays the audio from the given position from_position, in seconds.
seek Sets the position from which audio will be played, in seconds.
setAreaMask
setAttenuationFilterCutoffHz
setAttenuationFilterDb
setAttenuationModel
setAutoplay
setBus
setDopplerTracking
setEmissionAngle
setEmissionAngleEnabled
setEmissionAngleFilterAttenuationDb
setMaxDb
setMaxDistance
setOutOfRangeMode
setPitchScale
setStream
setStreamPaused
setUnitDb
setUnitSize
stop Stops the audio.

Enums

NameDescription
AttenuationModel
Constants
DopplerTracking
OutOfRangeMode