mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
176 lines
8.5 KiB
ReStructuredText
176 lines
8.5 KiB
ReStructuredText
.. 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/<name>/doc_classes.
|
|
|
|
.. _class_AudioStreamPlayer:
|
|
|
|
AudioStreamPlayer
|
|
=================
|
|
|
|
**Inherits:** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
Plays back audio.
|
|
|
|
Member Functions
|
|
----------------
|
|
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_string>` | :ref:`get_bus<class_AudioStreamPlayer_get_bus>` **(** **)** const |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_mix_target<class_AudioStreamPlayer_get_mix_target>` **(** **)** const |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer_get_playback_position>` **(** **)** |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`AudioStream<class_audiostream>` | :ref:`get_stream<class_AudioStreamPlayer_get_stream>` **(** **)** const |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_volume_db<class_AudioStreamPlayer_get_volume_db>` **(** **)** const |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_autoplay_enabled<class_AudioStreamPlayer_is_autoplay_enabled>` **(** **)** |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AudioStreamPlayer_is_playing>` **(** **)** const |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`play<class_AudioStreamPlayer_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`seek<class_AudioStreamPlayer_seek>` **(** :ref:`float<class_float>` to_position **)** |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_autoplay<class_AudioStreamPlayer_set_autoplay>` **(** :ref:`bool<class_bool>` enable **)** |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_bus<class_AudioStreamPlayer_set_bus>` **(** :ref:`String<class_string>` bus **)** |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_mix_target<class_AudioStreamPlayer_set_mix_target>` **(** :ref:`int<class_int>` mix_target **)** |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_stream<class_AudioStreamPlayer_set_stream>` **(** :ref:`AudioStream<class_audiostream>` stream **)** |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_volume_db<class_AudioStreamPlayer_set_volume_db>` **(** :ref:`float<class_float>` volume_db **)** |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`stop<class_AudioStreamPlayer_stop>` **(** **)** |
|
|
+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Signals
|
|
-------
|
|
|
|
.. _class_AudioStreamPlayer_finished:
|
|
|
|
- **finished** **(** **)**
|
|
|
|
Emitted when the audio stops playing.
|
|
|
|
|
|
Member Variables
|
|
----------------
|
|
|
|
.. _class_AudioStreamPlayer_autoplay:
|
|
|
|
- :ref:`bool<class_bool>` **autoplay** - If ``true`` audio plays when added to scene tree. Default value: ``false``.
|
|
|
|
.. _class_AudioStreamPlayer_bus:
|
|
|
|
- :ref:`String<class_string>` **bus** - Bus on which this audio is playing.
|
|
|
|
.. _class_AudioStreamPlayer_mix_target:
|
|
|
|
- :ref:`int<class_int>` **mix_target** - If the audio configuration has more than two speakers, this sets the target channels. See ``MIX_TARGET\_\*`` constants.
|
|
|
|
.. _class_AudioStreamPlayer_playing:
|
|
|
|
- :ref:`bool<class_bool>` **playing** - If ``true`` audio is playing.
|
|
|
|
.. _class_AudioStreamPlayer_stream:
|
|
|
|
- :ref:`AudioStream<class_audiostream>` **stream** - The :ref:`AudioStream<class_audiostream>` object to be played.
|
|
|
|
.. _class_AudioStreamPlayer_volume_db:
|
|
|
|
- :ref:`float<class_float>` **volume_db** - Volume of sound, in dB.
|
|
|
|
|
|
Numeric Constants
|
|
-----------------
|
|
|
|
- **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 background audio.
|
|
|
|
Member Function Description
|
|
---------------------------
|
|
|
|
.. _class_AudioStreamPlayer_get_bus:
|
|
|
|
- :ref:`String<class_string>` **get_bus** **(** **)** const
|
|
|
|
.. _class_AudioStreamPlayer_get_mix_target:
|
|
|
|
- :ref:`int<class_int>` **get_mix_target** **(** **)** const
|
|
|
|
.. _class_AudioStreamPlayer_get_playback_position:
|
|
|
|
- :ref:`float<class_float>` **get_playback_position** **(** **)**
|
|
|
|
Returns the position in the :ref:`AudioStream<class_audiostream>`.
|
|
|
|
.. _class_AudioStreamPlayer_get_stream:
|
|
|
|
- :ref:`AudioStream<class_audiostream>` **get_stream** **(** **)** const
|
|
|
|
.. _class_AudioStreamPlayer_get_volume_db:
|
|
|
|
- :ref:`float<class_float>` **get_volume_db** **(** **)** const
|
|
|
|
.. _class_AudioStreamPlayer_is_autoplay_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
|
|
|
|
.. _class_AudioStreamPlayer_is_playing:
|
|
|
|
- :ref:`bool<class_bool>` **is_playing** **(** **)** const
|
|
|
|
.. _class_AudioStreamPlayer_play:
|
|
|
|
- void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
|
|
|
|
Plays the audio from the given position 'from_position', in seconds.
|
|
|
|
.. _class_AudioStreamPlayer_seek:
|
|
|
|
- void **seek** **(** :ref:`float<class_float>` to_position **)**
|
|
|
|
Sets the position from which audio will be played, in seconds.
|
|
|
|
.. _class_AudioStreamPlayer_set_autoplay:
|
|
|
|
- void **set_autoplay** **(** :ref:`bool<class_bool>` enable **)**
|
|
|
|
.. _class_AudioStreamPlayer_set_bus:
|
|
|
|
- void **set_bus** **(** :ref:`String<class_string>` bus **)**
|
|
|
|
.. _class_AudioStreamPlayer_set_mix_target:
|
|
|
|
- void **set_mix_target** **(** :ref:`int<class_int>` mix_target **)**
|
|
|
|
.. _class_AudioStreamPlayer_set_stream:
|
|
|
|
- void **set_stream** **(** :ref:`AudioStream<class_audiostream>` stream **)**
|
|
|
|
.. _class_AudioStreamPlayer_set_volume_db:
|
|
|
|
- void **set_volume_db** **(** :ref:`float<class_float>` volume_db **)**
|
|
|
|
.. _class_AudioStreamPlayer_stop:
|
|
|
|
- void **stop** **(** **)**
|
|
|
|
Stops the audio.
|
|
|
|
|