.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_StreamPlayer: StreamPlayer ============ **Inherits:** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Base class for audio stream playback. Member Functions ---------------- +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_buffering_msec` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_length` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_loop_count` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_loop_restart_time` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_pos` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`AudioStream` | :ref:`get_stream` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_stream_name` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_volume` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_volume_db` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_autoplay` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_loop` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_paused` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_playing` **(** **)** const | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`play` **(** :ref:`float` offset=0 **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`seek_pos` **(** :ref:`float` time **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_autoplay` **(** :ref:`bool` enabled **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_buffering_msec` **(** :ref:`int` msec **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_loop` **(** :ref:`bool` enabled **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_loop_restart_time` **(** :ref:`float` secs **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_paused` **(** :ref:`bool` paused **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_stream` **(** :ref:`AudioStream` stream **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_volume` **(** :ref:`float` volume **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_volume_db` **(** :ref:`float` db **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`stop` **(** **)** | +----------------------------------------+---------------------------------------------------------------------------------------------------------------------+ Signals ------- - **finished** **(** **)** This signal triggers when the player stops playing. It will not trigger on each loop. Description ----------- Base class for audio stream playback. Audio stream players inherit from it. Member Function Description --------------------------- .. _class_StreamPlayer_get_buffering_msec: - :ref:`int` **get_buffering_msec** **(** **)** const Return the size of the audio buffer. .. _class_StreamPlayer_get_length: - :ref:`float` **get_length** **(** **)** const Return the length of the stream, in seconds. .. _class_StreamPlayer_get_loop_count: - :ref:`int` **get_loop_count** **(** **)** const Return the number of times the playback has looped. .. _class_StreamPlayer_get_loop_restart_time: - :ref:`float` **get_loop_restart_time** **(** **)** const Return the point in time the stream will rewind to, when looping. .. _class_StreamPlayer_get_pos: - :ref:`float` **get_pos** **(** **)** const Return the playback position, in seconds. .. _class_StreamPlayer_get_stream: - :ref:`AudioStream` **get_stream** **(** **)** const Return the currently assigned stream. .. _class_StreamPlayer_get_stream_name: - :ref:`String` **get_stream_name** **(** **)** const Return the name of the currently assigned stream. This is not the file name, but a field inside the file. If no stream is assigned, if returns "". .. _class_StreamPlayer_get_volume: - :ref:`float` **get_volume** **(** **)** const Return the playback volume for this player. .. _class_StreamPlayer_get_volume_db: - :ref:`float` **get_volume_db** **(** **)** const Return the playback volume for this player, in decibels. .. _class_StreamPlayer_has_autoplay: - :ref:`bool` **has_autoplay** **(** **)** const Return whether this player will start playing as soon as it enters the scene tree. .. _class_StreamPlayer_has_loop: - :ref:`bool` **has_loop** **(** **)** const Return whether the stream will be restarted at the end. .. _class_StreamPlayer_is_paused: - :ref:`bool` **is_paused** **(** **)** const Return whether the playback is currently paused. .. _class_StreamPlayer_is_playing: - :ref:`bool` **is_playing** **(** **)** const Return whether this player is playing. .. _class_StreamPlayer_play: - void **play** **(** :ref:`float` offset=0 **)** Play the currently assigned stream, starting from a given position (in seconds). .. _class_StreamPlayer_seek_pos: - void **seek_pos** **(** :ref:`float` time **)** Set the playback position, in seconds. .. _class_StreamPlayer_set_autoplay: - void **set_autoplay** **(** :ref:`bool` enabled **)** Set whether this player will start playing as soon as it enters the scene tree. .. _class_StreamPlayer_set_buffering_msec: - void **set_buffering_msec** **(** :ref:`int` msec **)** Set the size (in milliseconds) of the audio buffer. A long audio buffer protects better against slowdowns, but responds worse to changes (in volume, stream played...). A shorter buffer takes less time to respond to changes, but may stutter if the application suffers some slowdown. Default is 500 milliseconds. .. _class_StreamPlayer_set_loop: - void **set_loop** **(** :ref:`bool` enabled **)** Set whether the stream will be restarted at the end. .. _class_StreamPlayer_set_loop_restart_time: - void **set_loop_restart_time** **(** :ref:`float` secs **)** Set the point in time the stream will rewind to, when looping. .. _class_StreamPlayer_set_paused: - void **set_paused** **(** :ref:`bool` paused **)** Pause stream playback. .. _class_StreamPlayer_set_stream: - void **set_stream** **(** :ref:`AudioStream` stream **)** Set the :ref:`EventStream` this player will play. .. _class_StreamPlayer_set_volume: - void **set_volume** **(** :ref:`float` volume **)** Set the playback volume for this player. This is a float between 0.0 (silent) and 1.0 (full volume). Values over 1.0 will amplify sound even more, but may introduce distortion. Negative values will just invert the output waveform, which produces no audible difference. .. _class_StreamPlayer_set_volume_db: - void **set_volume_db** **(** :ref:`float` db **)** Set the playback volume for this player, in decibels. This is a float between -80.0 (silent) and 0.0 (full volume). Values under -79.0 get truncated to -80, but values over 0.0 do not, so the warnings for overamplifying (see :ref:`set_volume`) still apply. .. _class_StreamPlayer_stop: - void **stop** **(** **)** Stop the playback.