Plays audio in 2D.
    public class AudioStreamPlayer2D : Node2D

Plays audio that dampens with distance from screen center.

Inheritance Chain

Constructors

    public AudioStreamPlayer2D()

Signals

    "finished" ()

Emitted when the audio stops playing.

Properties

    public uint AreaMask { get; set; }

Areas in which this sound plays.

    public float Attenuation { get; set; }

Dampens audio over distance with this as an exponent.

    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 float MaxDistance { get; set; }

Maximum distance from which audio is still hearable.

    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 VolumeDb { get; set; }

Base volume without dampening.

Methods

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

    [Obsolete("GetAttenuation is deprecated. Use the Attenuation property instead.")]
    public float GetAttenuation()

Getter for Attenuation

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

Getter for Bus

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

Getter for MaxDistance

    [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("GetVolumeDb is deprecated. Use the VolumeDb property instead.")]
    public float GetVolumeDb()

Getter for VolumeDb

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

Getter for Autoplay

    [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("SetAttenuation is deprecated. Use the Attenuation property instead.")]
    public void SetAttenuation(float curve)

Setter for Attenuation

    [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("SetMaxDistance is deprecated. Use the MaxDistance property instead.")]
    public void SetMaxDistance(float pixels)

Setter for MaxDistance

    [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("SetVolumeDb is deprecated. Use the VolumeDb property instead.")]
    public void SetVolumeDb(float volumeDb)

Setter for VolumeDb

    public void Stop()

Stops the audio.

Tags: