AudioStreamPlayer

    Category: Core

    Plays back audio.

    Properties

    Methods

    get_playback_position ( )
    get_stream_playback ( )
    void ( float from_position=0.0 )
    void ( float to_position )
    void ( )
    • finished ( )

    Emitted when the audio stops playing.

    Enumerations

    enum MixTarget:

    • MIX_TARGET_STEREO = 0 — The audio will be played only on the first channel.
    • MIX_TARGET_SURROUND = 1 — The audio will be played on all surround channels.
    • MIX_TARGET_CENTER = 2 — The audio will be played on the second channel, which is usually the center.

    Description

    Property Descriptions

    • autoplay
    Setterset_autoplay(value)
    Getteris_autoplay_enabled()

    If , audio plays when added to scene tree. Default value: .


    Bus on which this audio is playing.


    • mix_target
    Setterset_mix_target(value)
    Getterget_mix_target()

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


    Setterset_pitch_scale(value)
    Getterget_pitch_scale()

    Changes the pitch and the tempo of the audio.



    • stream
    Setterset_stream(value)
    Getterget_stream()

    The AudioStream object to be played.


    • stream_paused
    Setterset_stream_paused(value)
    Getterget_stream_paused()

    Volume of sound, in dB.

    Method Descriptions

    • get_playback_position ( )

    Returns the position in the AudioStream in seconds.


    • get_stream_playback ( )

    • void play ( float from_position=0.0 )

    Plays the audio from the given position ‘from_position’, in seconds.


    • void seek ( to_position )

    Stops the audio.