AudioStreamPlayer2D

    Category: Core

    Plays audio in 2D.

    Properties

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

    Signals

    • finished ( )

    Emitted when the audio stops playing.

    Plays audio that dampens with distance from screen center.

    Tutorials

    • area_mask
    Setterset_area_mask(value)
    Getterget_area_mask()

    Areas in which this sound plays.


    Setterset_attenuation(value)
    Getterget_attenuation()

    • autoplay

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


    Setterset_bus(value)
    Getterget_bus()

    Bus on which this audio is playing.


    • max_distance
    Setterset_max_distance(value)
    Getterget_max_distance()

    Maximum distance from which audio is still hearable.


    Setterset_pitch_scale(value)
    Getterget_pitch_scale()

    Changes the pitch and the tempo of the audio.


    If , audio is playing.


    • stream
    Setterset_stream(value)
    Getterget_stream()

    Setterset_stream_paused(value)
    Getterget_stream_paused()

    • volume_db
    Setterset_volume_db(value)
    Getterget_volume_db()

    Base volume without dampening.

    Method Descriptions

    • float get_playback_position ( )

    Returns the position in the .



    • void play ( from_position=0.0 )

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


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


    • void stop ( )

    Stops the audio.