:github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the AudioStreamPlayer.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_AudioStreamPlayer: AudioStreamPlayer ================= **Inherits:** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Plays back audio non-positionally. Properties ---------- +----------------------------------------------------+----------------------------------------------------------------------+----------+ | :ref:`bool` | :ref:`autoplay` | false | +----------------------------------------------------+----------------------------------------------------------------------+----------+ | :ref:`String` | :ref:`bus` | "Master" | +----------------------------------------------------+----------------------------------------------------------------------+----------+ | :ref:`MixTarget` | :ref:`mix_target` | 0 | +----------------------------------------------------+----------------------------------------------------------------------+----------+ | :ref:`float` | :ref:`pitch_scale` | 1.0 | +----------------------------------------------------+----------------------------------------------------------------------+----------+ | :ref:`bool` | :ref:`playing` | false | +----------------------------------------------------+----------------------------------------------------------------------+----------+ | :ref:`AudioStream` | :ref:`stream` | | +----------------------------------------------------+----------------------------------------------------------------------+----------+ | :ref:`bool` | :ref:`stream_paused` | false | +----------------------------------------------------+----------------------------------------------------------------------+----------+ | :ref:`float` | :ref:`volume_db` | 0.0 | +----------------------------------------------------+----------------------------------------------------------------------+----------+ Methods ------- +-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_playback_position` **(** **)** | +-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`AudioStreamPlayback` | :ref:`get_stream_playback` **(** **)** | +-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | void | :ref:`play` **(** :ref:`float` from_position=0.0 **)** | +-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | void | :ref:`seek` **(** :ref:`float` to_position **)** | +-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ | void | :ref:`stop` **(** **)** | +-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ Signals ------- .. _class_AudioStreamPlayer_signal_finished: - **finished** **(** **)** Emitted when the audio stops playing. Enumerations ------------ .. _enum_AudioStreamPlayer_MixTarget: .. _class_AudioStreamPlayer_constant_MIX_TARGET_STEREO: .. _class_AudioStreamPlayer_constant_MIX_TARGET_SURROUND: .. _class_AudioStreamPlayer_constant_MIX_TARGET_CENTER: 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 ----------- Plays an audio stream non-positionally. Tutorials --------- - :doc:`../tutorials/audio/audio_streams` Property Descriptions --------------------- .. _class_AudioStreamPlayer_property_autoplay: - :ref:`bool` **autoplay** +-----------+-----------------------+ | *Default* | false | +-----------+-----------------------+ | *Setter* | set_autoplay(value) | +-----------+-----------------------+ | *Getter* | is_autoplay_enabled() | +-----------+-----------------------+ If ``true``, audio plays when added to scene tree. .. _class_AudioStreamPlayer_property_bus: - :ref:`String` **bus** +-----------+----------------+ | *Default* | "Master" | +-----------+----------------+ | *Setter* | set_bus(value) | +-----------+----------------+ | *Getter* | get_bus() | +-----------+----------------+ Bus on which this audio is playing. .. _class_AudioStreamPlayer_property_mix_target: - :ref:`MixTarget` **mix_target** +-----------+-----------------------+ | *Default* | 0 | +-----------+-----------------------+ | *Setter* | set_mix_target(value) | +-----------+-----------------------+ | *Getter* | get_mix_target() | +-----------+-----------------------+ If the audio configuration has more than two speakers, this sets the target channels. See ``MIX_TARGET_*`` constants. .. _class_AudioStreamPlayer_property_pitch_scale: - :ref:`float` **pitch_scale** +-----------+------------------------+ | *Default* | 1.0 | +-----------+------------------------+ | *Setter* | set_pitch_scale(value) | +-----------+------------------------+ | *Getter* | get_pitch_scale() | +-----------+------------------------+ Changes the pitch and the tempo of the audio. .. _class_AudioStreamPlayer_property_playing: - :ref:`bool` **playing** +-----------+--------------+ | *Default* | false | +-----------+--------------+ | *Getter* | is_playing() | +-----------+--------------+ If ``true``, audio is playing. .. _class_AudioStreamPlayer_property_stream: - :ref:`AudioStream` **stream** +----------+-------------------+ | *Setter* | set_stream(value) | +----------+-------------------+ | *Getter* | get_stream() | +----------+-------------------+ The :ref:`AudioStream` object to be played. .. _class_AudioStreamPlayer_property_stream_paused: - :ref:`bool` **stream_paused** +-----------+--------------------------+ | *Default* | false | +-----------+--------------------------+ | *Setter* | set_stream_paused(value) | +-----------+--------------------------+ | *Getter* | get_stream_paused() | +-----------+--------------------------+ .. _class_AudioStreamPlayer_property_volume_db: - :ref:`float` **volume_db** +-----------+----------------------+ | *Default* | 0.0 | +-----------+----------------------+ | *Setter* | set_volume_db(value) | +-----------+----------------------+ | *Getter* | get_volume_db() | +-----------+----------------------+ Volume of sound, in dB. Method Descriptions ------------------- .. _class_AudioStreamPlayer_method_get_playback_position: - :ref:`float` **get_playback_position** **(** **)** Returns the position in the :ref:`AudioStream` in seconds. .. _class_AudioStreamPlayer_method_get_stream_playback: - :ref:`AudioStreamPlayback` **get_stream_playback** **(** **)** .. _class_AudioStreamPlayer_method_play: - void **play** **(** :ref:`float` from_position=0.0 **)** Plays the audio from the given ``from_position``, in seconds. .. _class_AudioStreamPlayer_method_seek: - void **seek** **(** :ref:`float` to_position **)** Sets the position from which audio will be played, in seconds. .. _class_AudioStreamPlayer_method_stop: - void **stop** **(** **)** Stops the audio.