Plays back audio.
    public class AudioStreamPlayer : Node

Plays background audio.

Inheritance Chain

Constructors

    public AudioStreamPlayer()

Signals

    "finished" ()

Emitted when the audio stops playing.

Properties

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

    public bool Playing { get; set; }

If true audio is playing.

    public AudioStream Stream { get; set; }

The AudioStream object to be played.

    public float VolumeDb { get; set; }

Volume of sound, in dB.

Methods

    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.

    public AudioStream GetStream()

Getter for Stream

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

Setter for VolumeDb

    public void Stop()

Stops the audio.

Inner Types

MixTargetEnum

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