mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-03 05:48:42 +03:00
138 lines
8.4 KiB
ReStructuredText
138 lines
8.4 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamPlaybackPolyphonic.xml.
|
|
|
|
.. _class_AudioStreamPlaybackPolyphonic:
|
|
|
|
AudioStreamPlaybackPolyphonic
|
|
=============================
|
|
|
|
**Inherits:** :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
Playback instance for :ref:`AudioStreamPolyphonic<class_AudioStreamPolyphonic>`.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Description
|
|
-----------
|
|
|
|
Playback instance for :ref:`AudioStreamPolyphonic<class_AudioStreamPolyphonic>`. After setting the ``stream`` property of :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`, :ref:`AudioStreamPlayer2D<class_AudioStreamPlayer2D>`, or :ref:`AudioStreamPlayer3D<class_AudioStreamPlayer3D>`, the playback instance can be obtained by calling :ref:`AudioStreamPlayer.get_stream_playback<class_AudioStreamPlayer_method_get_stream_playback>`, :ref:`AudioStreamPlayer2D.get_stream_playback<class_AudioStreamPlayer2D_method_get_stream_playback>` or :ref:`AudioStreamPlayer3D.get_stream_playback<class_AudioStreamPlayer3D_method_get_stream_playback>` methods.
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Methods
|
|
-------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_stream_playing<class_AudioStreamPlaybackPolyphonic_method_is_stream_playing>` **(** :ref:`int<class_int>` stream **)** |const| |
|
|
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>` **(** :ref:`AudioStream<class_AudioStream>` stream, :ref:`float<class_float>` from_offset=0, :ref:`float<class_float>` volume_db=0, :ref:`float<class_float>` pitch_scale=1.0 **)** |
|
|
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_stream_pitch_scale<class_AudioStreamPlaybackPolyphonic_method_set_stream_pitch_scale>` **(** :ref:`int<class_int>` stream, :ref:`float<class_float>` pitch_scale **)** |
|
|
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_stream_volume<class_AudioStreamPlaybackPolyphonic_method_set_stream_volume>` **(** :ref:`int<class_int>` stream, :ref:`float<class_float>` volume_db **)** |
|
|
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`stop_stream<class_AudioStreamPlaybackPolyphonic_method_stop_stream>` **(** :ref:`int<class_int>` stream **)** |
|
|
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Constants
|
|
---------
|
|
|
|
.. _class_AudioStreamPlaybackPolyphonic_constant_INVALID_ID:
|
|
|
|
.. rst-class:: classref-constant
|
|
|
|
**INVALID_ID** = ``-1``
|
|
|
|
Returned by :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>` in case it could not allocate a stream for playback.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_AudioStreamPlaybackPolyphonic_method_is_stream_playing:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **is_stream_playing** **(** :ref:`int<class_int>` stream **)** |const|
|
|
|
|
Return true whether the stream associated with an integer ID is still playing. Check :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>` for information on when this ID becomes invalid.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AudioStreamPlaybackPolyphonic_method_play_stream:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`int<class_int>` **play_stream** **(** :ref:`AudioStream<class_AudioStream>` stream, :ref:`float<class_float>` from_offset=0, :ref:`float<class_float>` volume_db=0, :ref:`float<class_float>` pitch_scale=1.0 **)**
|
|
|
|
Play an :ref:`AudioStream<class_AudioStream>` at a given offset, volume and pitch scale. Playback starts immediately.
|
|
|
|
The return value is an unique integer ID that is associated to this playback stream and which can be used to control it.
|
|
|
|
This ID becomes invalid when the stream ends (if it does not loop), when the **AudioStreamPlaybackPolyphonic** is stopped, or when :ref:`stop_stream<class_AudioStreamPlaybackPolyphonic_method_stop_stream>` is called.
|
|
|
|
This function returns :ref:`INVALID_ID<class_AudioStreamPlaybackPolyphonic_constant_INVALID_ID>` if the amount of streams currently playing equals :ref:`AudioStreamPolyphonic.polyphony<class_AudioStreamPolyphonic_property_polyphony>`. If you need a higher amount of maximum polyphony, raise this value.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AudioStreamPlaybackPolyphonic_method_set_stream_pitch_scale:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **set_stream_pitch_scale** **(** :ref:`int<class_int>` stream, :ref:`float<class_float>` pitch_scale **)**
|
|
|
|
Change the stream pitch scale. The ``stream`` argument is an integer ID returned by :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AudioStreamPlaybackPolyphonic_method_set_stream_volume:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **set_stream_volume** **(** :ref:`int<class_int>` stream, :ref:`float<class_float>` volume_db **)**
|
|
|
|
Change the stream volume (in db). The ``stream`` argument is an integer ID returned by :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AudioStreamPlaybackPolyphonic_method_stop_stream:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **stop_stream** **(** :ref:`int<class_int>` stream **)**
|
|
|
|
Stop a stream. The ``stream`` argument is an integer ID returned by :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>`, which becomes invalid after calling this function.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
|
|
.. |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.)`
|