Plays back audio.
    public class AudioStreamPlayer : Node

Plays background audio.

Inheritance Chain


    public AudioStreamPlayer()


    "finished" ()

Emitted when the audio stops playing.


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

If the audio configuration has more than two speakers, this sets the target channels. See MIX_TARGET_* constants.

    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; }

Volume of sound, in dB.


    public string GetBus()

Getter for Bus

    public MixTargetEnum GetMixTarget()

Getter for MixTarget

    public float GetPitchScale()

Getter for PitchScale

    public float GetPlaybackPosition()

Returns the position in the AudioStream in seconds.

    public AudioStream GetStream()

Getter for Stream

    public bool GetStreamPaused()

Getter for StreamPaused

    public AudioStreamPlayback GetStreamPlayback()

    public float GetVolumeDb()

Getter for VolumeDb

    public bool IsAutoplayEnabled()

Getter for Autoplay

    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 SetAutoplay(bool enable)

Setter for Autoplay

    public void SetBus(string bus)

Setter for Bus

    public void SetMixTarget(MixTargetEnum mixTarget)

Setter for MixTarget

    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 SetVolumeDb(float volumeDb)

Setter for VolumeDb

    public void Stop()

Stops the audio.

Inner Types


Name Value Description
Stereo 0 The audio will be played only on the first channel.
Surround 1 The audio will be played on all surround channels.
Center 2 The audio will be played on the second channel, which is usually the center.