Plays back audio non-positionally.
    public class AudioStreamPlayer : Node

Plays an audio stream non-positionally.

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.

    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.

Methods

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

Getter for Bus

    [Obsolete("GetMixTarget is deprecated. Use the MixTarget property instead.")]
    public MixTargetEnum GetMixTarget()

Getter for MixTarget

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

Getter for PitchScale

    public float GetPlaybackPosition()

Returns the position in the AudioStream in seconds.

    [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 fromPosition, in seconds.

    public void Seek(float toPosition)

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

    [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("SetMixTarget is deprecated. Use the MixTarget property instead.")]
    public void SetMixTarget(MixTargetEnum mixTarget)

Setter for MixTarget

    [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.

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: