Plays 3D sound in 3D space.
    public class AudioStreamPlayer3D : Spatial

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

Inheritance Chain


    public AudioStreamPlayer3D()


    "finished" ()

Fires when the audio stops playing.


    public int AreaMask { get; set; }

Areas in which this sound plays.

    public float AttenuationFilterCutoffHz { get; set; }

Dampens audio above this frequency, in Hz.

    public float AttenuationFilterDb { get; set; }

Amount how much the filter affects the loudness, in dB.

    public AttenuationModelEnum AttenuationModel { get; set; }

Decides if audio should get quieter with distance linearly, quadratically or logarithmically.

    public bool Autoplay { get; set; }

If true, audio plays when added to scene tree. Default value: false.

    public string Bus { get; set; }

Bus on which this audio is playing.

    public DopplerTrackingEnum DopplerTracking { get; set; }

Decides in which step the Doppler effect should be calculated.

    public float EmissionAngleDegrees { get; set; }

The angle in which the audio reaches cameras undampened.

    public bool EmissionAngleEnabled { get; set; }

If true, the audio should be dampened according to the direction of the sound.

    public float EmissionAngleFilterAttenuationDb { get; set; }

dampens audio if camera is outside of ‘emission_angle_degrees’ and ‘emission_angle_enabled’ is set by this factor, in dB.

    public float MaxDb { get; set; }

Sets the absolute maximum of the soundlevel, in dB.

    public float MaxDistance { get; set; }

Sets the distance from which the ‘out_of_range_mode’ takes effect. Has no effect if set to 0.

    public OutOfRangeModeEnum OutOfRangeMode { get; set; }

Decides if audio should pause when source is outside of ‘max_distance’ range.

    public float PitchScale { get; set; }

Changes the pitch and the tempo of the audio.

    public bool Playing { get; set; }

If true, audio is playing.

    public AudioStream Stream { get; set; }

The AudioStream object to be played.

    public bool StreamPaused { get; set; }

    public float UnitDb { get; set; }

Base sound level unaffected by dampening, in dB.

    public float UnitSize { get; set; }

Factor for the attenuation effect.


    public int GetAreaMask()

Getter for AreaMask

    public float GetAttenuationFilterCutoffHz()

Getter for AttenuationFilterCutoffHz

    public float GetAttenuationFilterDb()

Getter for AttenuationFilterDb

    public AttenuationModelEnum GetAttenuationModel()

Getter for AttenuationModel

    public string GetBus()

Getter for Bus

    public DopplerTrackingEnum GetDopplerTracking()

Getter for DopplerTracking

    public float GetEmissionAngle()

Getter for EmissionAngleDegrees

    public float GetEmissionAngleFilterAttenuationDb()

Getter for EmissionAngleFilterAttenuationDb

    public float GetMaxDb()

Getter for MaxDb

    public float GetMaxDistance()

Getter for MaxDistance

    public OutOfRangeModeEnum GetOutOfRangeMode()

Getter for OutOfRangeMode

    public float GetPitchScale()

Getter for PitchScale

    public float GetPlaybackPosition()

Returns the position in the AudioStream.

    public AudioStream GetStream()

Getter for Stream

    public bool GetStreamPaused()

Getter for StreamPaused

    public float GetUnitDb()

Getter for UnitDb

    public float GetUnitSize()

Getter for UnitSize

    public bool IsAutoplayEnabled()

Getter for Autoplay

    public bool IsEmissionAngleEnabled()

Getter for EmissionAngleEnabled

    public bool IsPlaying()

Getter for Playing

    public void Play(float fromPosition = 0f)

Plays the audio from the given position ‘from_position’, in seconds.

    public void Seek(float toPosition)

Sets the position from which audio will be played, in seconds.

    public void SetAreaMask(int mask)

Setter for AreaMask

    public void SetAttenuationFilterCutoffHz(float degrees)

Setter for AttenuationFilterCutoffHz

    public void SetAttenuationFilterDb(float db)

Setter for AttenuationFilterDb

    public void SetAttenuationModel(AttenuationModelEnum model)

Setter for AttenuationModel

    public void SetAutoplay(bool enable)

Setter for Autoplay

    public void SetBus(string bus)

Setter for Bus

    public void SetDopplerTracking(DopplerTrackingEnum mode)

Setter for DopplerTracking

    public void SetEmissionAngle(float degrees)

Setter for EmissionAngleDegrees

    public void SetEmissionAngleEnabled(bool enabled)

Setter for EmissionAngleEnabled

    public void SetEmissionAngleFilterAttenuationDb(float db)

Setter for EmissionAngleFilterAttenuationDb

    public void SetMaxDb(float maxDb)

Setter for MaxDb

    public void SetMaxDistance(float metres)

Setter for MaxDistance

    public void SetOutOfRangeMode(OutOfRangeModeEnum mode)

Setter for OutOfRangeMode

    public void SetPitchScale(float pitchScale)

Setter for PitchScale

    public void SetStream(AudioStream stream)

Setter for Stream

    public void SetStreamPaused(bool pause)

Setter for StreamPaused

    public void SetUnitDb(float unitDb)

Setter for UnitDb

    public void SetUnitSize(float unitSize)

Setter for UnitSize

    public void Stop()

Stops the audio.

Inner Types


Name Value Description
InverseDistance 0 Linear dampening of loudness according to distance.
InverseSquareDistance 1 Squared dampening of loudness according to distance.
Logarithmic 2 Logarithmic dampening of loudness according to distance.


Name Value Description
Disabled 0 Disables doppler tracking.
IdleStep 1 Executes doppler tracking in idle step.
PhysicsStep 2 Executes doppler tracking in physics step.


Name Value Description
Mix 0 Mix this audio in, even when it’s out of range.
Pause 1 Pause this audio when it gets out of range.