ESCAmbientPlayer

Extends: Control

Description

Background ambient sound player

Members

global_id

var global_id: String

Global id of the background ambient sound player.

state

var state: String

The state of the music player. “default” or “off” disable music. Any other state refers to a music stream that should be played.

stream

var stream: AudioStreamPlayer

Reference to the audio player.

Methods


set_state

func set_state(p_state: String, from_seconds: float, p_force: bool) -> void

Sets the state of this player.

Parameters

  • p_state: New state to use.

  • from_seconds: Sets the starting playback position.

  • p_force: Override the existing state even if the stream is still playing.


get_playback_position

func get_playback_position() -> float

Returns the playback position of the audio stream in seconds.

Returns the playback position as a float value.