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

Constructors

    public AudioStreamPlayer3D()

Signals

    "finished" ()

Emitted when the audio stops playing.

Properties

    public uint 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, logarithmically, or not be affected by distance, effectively disabling attenuation.

    public bool Autoplay { get; set; }

If true, audio plays when added to scene tree.

    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 EmissionAngleDegrees and EmissionAngleEnabled 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 OutOfRangeMode takes effect. Has no effect if set to 0.

    public OutOfRangeModeEnum OutOfRangeMode { get; set; }

Decides if audio should pause when source is outside of MaxDistance 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.

Methods

    [Obsolete("GetAreaMask is deprecated. Use the AreaMask property instead.")]
    public uint GetAreaMask()

    [Obsolete("GetAttenuationFilterCutoffHz is deprecated. Use the AttenuationFilterCutoffHz property instead.")]
    public float GetAttenuationFilterCutoffHz()

Getter for AttenuationFilterCutoffHz

    [Obsolete("GetAttenuationFilterDb is deprecated. Use the AttenuationFilterDb property instead.")]
    public float GetAttenuationFilterDb()

Getter for AttenuationFilterDb

    [Obsolete("GetAttenuationModel is deprecated. Use the AttenuationModel property instead.")]
    public AttenuationModelEnum GetAttenuationModel()

Getter for AttenuationModel

    [Obsolete("GetBus is deprecated. Use the Bus property instead.")]
    public string GetBus()

Getter for Bus

    [Obsolete("GetDopplerTracking is deprecated. Use the DopplerTracking property instead.")]
    public DopplerTrackingEnum GetDopplerTracking()

Getter for DopplerTracking

    [Obsolete("GetEmissionAngle is deprecated. Use the EmissionAngleDegrees property instead.")]
    public float GetEmissionAngle()

Getter for EmissionAngleDegrees

    [Obsolete("GetEmissionAngleFilterAttenuationDb is deprecated. Use the EmissionAngleFilterAttenuationDb property instead.")]
    public float GetEmissionAngleFilterAttenuationDb()

Getter for EmissionAngleFilterAttenuationDb

    [Obsolete("GetMaxDb is deprecated. Use the MaxDb property instead.")]
    public float GetMaxDb()

Getter for MaxDb

    [Obsolete("GetMaxDistance is deprecated. Use the MaxDistance property instead.")]
    public float GetMaxDistance()

Getter for MaxDistance

    [Obsolete("GetOutOfRangeMode is deprecated. Use the OutOfRangeMode property instead.")]
    public OutOfRangeModeEnum GetOutOfRangeMode()

Getter for OutOfRangeMode

    [Obsolete("GetPitchScale is deprecated. Use the PitchScale property instead.")]
    public float GetPitchScale()

Getter for PitchScale

    public float GetPlaybackPosition()

Returns the position in the AudioStream.

    [Obsolete("GetStream is deprecated. Use the Stream property instead.")]
    public AudioStream GetStream()

Getter for Stream

    [Obsolete("GetStreamPaused is deprecated. Use the StreamPaused property instead.")]
    public bool GetStreamPaused()

Getter for StreamPaused

    public AudioStreamPlayback GetStreamPlayback()

    [Obsolete("GetUnitDb is deprecated. Use the UnitDb property instead.")]
    public float GetUnitDb()

Getter for UnitDb

    [Obsolete("GetUnitSize is deprecated. Use the UnitSize property instead.")]
    public float GetUnitSize()

Getter for UnitSize

    [Obsolete("IsAutoplayEnabled is deprecated. Use the Autoplay property instead.")]
    public bool IsAutoplayEnabled()

Getter for Autoplay

    [Obsolete("IsEmissionAngleEnabled is deprecated. Use the EmissionAngleEnabled property instead.")]
    public bool IsEmissionAngleEnabled()

Getter for EmissionAngleEnabled

    [Obsolete("IsPlaying is deprecated. Use the Playing property instead.")]
    public bool IsPlaying()

Getter for Playing

    public void Play(float fromPosition = 0f)

Plays the audio from the given position fromPosition, in seconds.

    public void Seek(float toPosition)

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

    [Obsolete("SetAreaMask is deprecated. Use the AreaMask property instead.")]
    public void SetAreaMask(uint mask)

    [Obsolete("SetAttenuationFilterCutoffHz is deprecated. Use the AttenuationFilterCutoffHz property instead.")]
    public void SetAttenuationFilterCutoffHz(float degrees)

Setter for AttenuationFilterCutoffHz

    [Obsolete("SetAttenuationFilterDb is deprecated. Use the AttenuationFilterDb property instead.")]
    public void SetAttenuationFilterDb(float db)

Setter for AttenuationFilterDb

    [Obsolete("SetAttenuationModel is deprecated. Use the AttenuationModel property instead.")]
    public void SetAttenuationModel(AttenuationModelEnum model)

Setter for AttenuationModel

    [Obsolete("SetAutoplay is deprecated. Use the Autoplay property instead.")]
    public void SetAutoplay(bool enable)

Setter for Autoplay

    [Obsolete("SetBus is deprecated. Use the Bus property instead.")]
    public void SetBus(string bus)

Setter for Bus

    [Obsolete("SetDopplerTracking is deprecated. Use the DopplerTracking property instead.")]
    public void SetDopplerTracking(DopplerTrackingEnum mode)

Setter for DopplerTracking

    [Obsolete("SetEmissionAngle is deprecated. Use the EmissionAngleDegrees property instead.")]
    public void SetEmissionAngle(float degrees)

Setter for EmissionAngleDegrees

    [Obsolete("SetEmissionAngleEnabled is deprecated. Use the EmissionAngleEnabled property instead.")]
    public void SetEmissionAngleEnabled(bool enabled)

Setter for EmissionAngleEnabled

    [Obsolete("SetEmissionAngleFilterAttenuationDb is deprecated. Use the EmissionAngleFilterAttenuationDb property instead.")]
    public void SetEmissionAngleFilterAttenuationDb(float db)

Setter for EmissionAngleFilterAttenuationDb

    [Obsolete("SetMaxDb is deprecated. Use the MaxDb property instead.")]
    public void SetMaxDb(float maxDb)

Setter for MaxDb

    [Obsolete("SetMaxDistance is deprecated. Use the MaxDistance property instead.")]
    public void SetMaxDistance(float metres)

Setter for MaxDistance

    [Obsolete("SetOutOfRangeMode is deprecated. Use the OutOfRangeMode property instead.")]
    public void SetOutOfRangeMode(OutOfRangeModeEnum mode)

Setter for OutOfRangeMode

    [Obsolete("SetPitchScale is deprecated. Use the PitchScale property instead.")]
    public void SetPitchScale(float pitchScale)

Setter for PitchScale

    [Obsolete("SetStream is deprecated. Use the Stream property instead.")]
    public void SetStream(AudioStream stream)

Setter for Stream

    [Obsolete("SetStreamPaused is deprecated. Use the StreamPaused property instead.")]
    public void SetStreamPaused(bool pause)

Setter for StreamPaused

    [Obsolete("SetUnitDb is deprecated. Use the UnitDb property instead.")]
    public void SetUnitDb(float unitDb)

Setter for UnitDb

    [Obsolete("SetUnitSize is deprecated. Use the UnitSize property instead.")]
    public void SetUnitSize(float unitSize)

Setter for UnitSize

    public void Stop()

Stops the audio.

Inner Types

AttenuationModelEnum

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.
Disabled 3 No dampening of loudness according to distance.

DopplerTrackingEnum

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

OutOfRangeModeEnum

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.
Tags: