mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 17:28:58 +00:00
classref: Sync with current master branch (2e7fc81)
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
:github_url: hide
|
||||
|
||||
.. meta::
|
||||
:keywords: sound, sfx
|
||||
|
||||
.. DO NOT EDIT THIS FILE!!!
|
||||
.. Generated automatically from Godot engine sources.
|
||||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||||
@@ -76,19 +79,19 @@ Methods
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer2D_method_get_playback_position>` **(** **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer2D_method_get_stream_playback>` **(** **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_stream_playback<class_AudioStreamPlayer2D_method_has_stream_playback>` **(** **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`play<class_AudioStreamPlayer2D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`seek<class_AudioStreamPlayer2D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`stop<class_AudioStreamPlayer2D_method_stop>` **(** **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer2D_method_get_playback_position>`\ (\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer2D_method_get_stream_playback>`\ (\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_stream_playback<class_AudioStreamPlayer2D_method_has_stream_playback>`\ (\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`play<class_AudioStreamPlayer2D_method_play>`\ (\ from_position\: :ref:`float<class_float>` = 0.0\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`seek<class_AudioStreamPlayer2D_method_seek>`\ (\ to_position\: :ref:`float<class_float>`\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+
|
||||
| |void| | :ref:`stop<class_AudioStreamPlayer2D_method_stop>`\ (\ ) |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
@@ -103,7 +106,7 @@ Signals
|
||||
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**finished** **(** **)**
|
||||
**finished**\ (\ )
|
||||
|
||||
Emitted when the audio stops playing.
|
||||
|
||||
@@ -124,8 +127,8 @@ Property Descriptions
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_area_mask** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_area_mask** **(** **)**
|
||||
- |void| **set_area_mask**\ (\ value\: :ref:`int<class_int>`\ )
|
||||
- :ref:`int<class_int>` **get_area_mask**\ (\ )
|
||||
|
||||
Determines which :ref:`Area2D<class_Area2D>` layers affect the sound for reverb and audio bus effects. Areas can be used to redirect :ref:`AudioStream<class_AudioStream>`\ s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater.
|
||||
|
||||
@@ -141,8 +144,8 @@ Determines which :ref:`Area2D<class_Area2D>` layers affect the sound for reverb
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_attenuation** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_attenuation** **(** **)**
|
||||
- |void| **set_attenuation**\ (\ value\: :ref:`float<class_float>`\ )
|
||||
- :ref:`float<class_float>` **get_attenuation**\ (\ )
|
||||
|
||||
The volume is attenuated over distance with this as an exponent.
|
||||
|
||||
@@ -158,8 +161,8 @@ The volume is attenuated over distance with this as an exponent.
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_autoplay** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
|
||||
- |void| **set_autoplay**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||||
- :ref:`bool<class_bool>` **is_autoplay_enabled**\ (\ )
|
||||
|
||||
If ``true``, audio plays when added to scene tree.
|
||||
|
||||
@@ -175,8 +178,8 @@ If ``true``, audio plays when added to scene tree.
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_bus** **(** :ref:`StringName<class_StringName>` value **)**
|
||||
- :ref:`StringName<class_StringName>` **get_bus** **(** **)**
|
||||
- |void| **set_bus**\ (\ value\: :ref:`StringName<class_StringName>`\ )
|
||||
- :ref:`StringName<class_StringName>` **get_bus**\ (\ )
|
||||
|
||||
Bus on which this audio is playing.
|
||||
|
||||
@@ -194,8 +197,8 @@ Bus on which this audio is playing.
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_max_distance** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_max_distance** **(** **)**
|
||||
- |void| **set_max_distance**\ (\ value\: :ref:`float<class_float>`\ )
|
||||
- :ref:`float<class_float>` **get_max_distance**\ (\ )
|
||||
|
||||
Maximum distance from which audio is still hearable.
|
||||
|
||||
@@ -211,8 +214,8 @@ Maximum distance from which audio is still hearable.
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_max_polyphony** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_max_polyphony** **(** **)**
|
||||
- |void| **set_max_polyphony**\ (\ value\: :ref:`int<class_int>`\ )
|
||||
- :ref:`int<class_int>` **get_max_polyphony**\ (\ )
|
||||
|
||||
The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds.
|
||||
|
||||
@@ -228,8 +231,8 @@ The maximum number of sounds this node can play at the same time. Playing additi
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_panning_strength** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_panning_strength** **(** **)**
|
||||
- |void| **set_panning_strength**\ (\ value\: :ref:`float<class_float>`\ )
|
||||
- :ref:`float<class_float>` **get_panning_strength**\ (\ )
|
||||
|
||||
Scales the panning strength for this node by multiplying the base :ref:`ProjectSettings.audio/general/2d_panning_strength<class_ProjectSettings_property_audio/general/2d_panning_strength>` with this factor. Higher values will pan audio from left to right more dramatically than lower values.
|
||||
|
||||
@@ -245,8 +248,8 @@ Scales the panning strength for this node by multiplying the base :ref:`ProjectS
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_pitch_scale** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_pitch_scale** **(** **)**
|
||||
- |void| **set_pitch_scale**\ (\ value\: :ref:`float<class_float>`\ )
|
||||
- :ref:`float<class_float>` **get_pitch_scale**\ (\ )
|
||||
|
||||
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
|
||||
|
||||
@@ -262,7 +265,7 @@ The pitch and the tempo of the audio, as a multiplier of the audio sample's samp
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- :ref:`bool<class_bool>` **is_playing** **(** **)**
|
||||
- :ref:`bool<class_bool>` **is_playing**\ (\ )
|
||||
|
||||
If ``true``, audio is playing or is queued to be played (see :ref:`play<class_AudioStreamPlayer2D_method_play>`).
|
||||
|
||||
@@ -278,8 +281,8 @@ If ``true``, audio is playing or is queued to be played (see :ref:`play<class_Au
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_stream** **(** :ref:`AudioStream<class_AudioStream>` value **)**
|
||||
- :ref:`AudioStream<class_AudioStream>` **get_stream** **(** **)**
|
||||
- |void| **set_stream**\ (\ value\: :ref:`AudioStream<class_AudioStream>`\ )
|
||||
- :ref:`AudioStream<class_AudioStream>` **get_stream**\ (\ )
|
||||
|
||||
The :ref:`AudioStream<class_AudioStream>` object to be played.
|
||||
|
||||
@@ -295,8 +298,8 @@ The :ref:`AudioStream<class_AudioStream>` object to be played.
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_stream_paused** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **get_stream_paused** **(** **)**
|
||||
- |void| **set_stream_paused**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||||
- :ref:`bool<class_bool>` **get_stream_paused**\ (\ )
|
||||
|
||||
If ``true``, the playback is paused. You can resume it by setting :ref:`stream_paused<class_AudioStreamPlayer2D_property_stream_paused>` to ``false``.
|
||||
|
||||
@@ -312,8 +315,8 @@ If ``true``, the playback is paused. You can resume it by setting :ref:`stream_p
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_volume_db** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_volume_db** **(** **)**
|
||||
- |void| **set_volume_db**\ (\ value\: :ref:`float<class_float>`\ )
|
||||
- :ref:`float<class_float>` **get_volume_db**\ (\ )
|
||||
|
||||
Base volume before attenuation.
|
||||
|
||||
@@ -330,7 +333,7 @@ Method Descriptions
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_playback_position** **(** **)**
|
||||
:ref:`float<class_float>` **get_playback_position**\ (\ )
|
||||
|
||||
Returns the position in the :ref:`AudioStream<class_AudioStream>`.
|
||||
|
||||
@@ -342,7 +345,7 @@ Returns the position in the :ref:`AudioStream<class_AudioStream>`.
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
|
||||
:ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback**\ (\ )
|
||||
|
||||
Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this **AudioStreamPlayer2D**.
|
||||
|
||||
@@ -354,7 +357,7 @@ Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associa
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **has_stream_playback** **(** **)**
|
||||
:ref:`bool<class_bool>` **has_stream_playback**\ (\ )
|
||||
|
||||
Returns whether the :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` can return the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object or not.
|
||||
|
||||
@@ -366,7 +369,7 @@ Returns whether the :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` can return
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
|
||||
|void| **play**\ (\ from_position\: :ref:`float<class_float>` = 0.0\ )
|
||||
|
||||
Queues the audio to play on the next physics frame, from the given position ``from_position``, in seconds.
|
||||
|
||||
@@ -378,7 +381,7 @@ Queues the audio to play on the next physics frame, from the given position ``fr
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **seek** **(** :ref:`float<class_float>` to_position **)**
|
||||
|void| **seek**\ (\ to_position\: :ref:`float<class_float>`\ )
|
||||
|
||||
Sets the position from which audio will be played, in seconds.
|
||||
|
||||
@@ -390,7 +393,7 @@ Sets the position from which audio will be played, in seconds.
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **stop** **(** **)**
|
||||
|void| **stop**\ (\ )
|
||||
|
||||
Stops the audio.
|
||||
|
||||
@@ -401,3 +404,4 @@ Stops the audio.
|
||||
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|
||||
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|
||||
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|
||||
.. |void| replace:: :abbr:`void (No return value.)`
|
||||
|
||||
Reference in New Issue
Block a user