: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` **<** :ref:`RefCounted` **<** :ref:`Object` Playback instance for :ref:`AudioStreamPolyphonic`. .. rst-class:: classref-introduction-group Description ----------- Playback instance for :ref:`AudioStreamPolyphonic`. After setting the ``stream`` property of :ref:`AudioStreamPlayer`, :ref:`AudioStreamPlayer2D`, or :ref:`AudioStreamPlayer3D`, the playback instance can be obtained by calling :ref:`AudioStreamPlayer.get_stream_playback()`, :ref:`AudioStreamPlayer2D.get_stream_playback()` or :ref:`AudioStreamPlayer3D.get_stream_playback()` methods. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_stream_playing`\ (\ stream\: :ref:`int`\ ) |const| | +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`play_stream`\ (\ stream\: :ref:`AudioStream`, from_offset\: :ref:`float` = 0, volume_db\: :ref:`float` = 0, pitch_scale\: :ref:`float` = 1.0, playback_type\: :ref:`PlaybackType` = 0, bus\: :ref:`StringName` = &"Master"\ ) | +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_stream_pitch_scale`\ (\ stream\: :ref:`int`, pitch_scale\: :ref:`float`\ ) | +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_stream_volume`\ (\ stream\: :ref:`int`, volume_db\: :ref:`float`\ ) | +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`stop_stream`\ (\ stream\: :ref:`int`\ ) | +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Constants --------- .. _class_AudioStreamPlaybackPolyphonic_constant_INVALID_ID: .. rst-class:: classref-constant **INVALID_ID** = ``-1`` :ref:`🔗` Returned by :ref:`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` **is_stream_playing**\ (\ stream\: :ref:`int`\ ) |const| :ref:`🔗` Returns ``true`` if the stream associated with the given integer ID is still playing. Check :ref:`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` **play_stream**\ (\ stream\: :ref:`AudioStream`, from_offset\: :ref:`float` = 0, volume_db\: :ref:`float` = 0, pitch_scale\: :ref:`float` = 1.0, playback_type\: :ref:`PlaybackType` = 0, bus\: :ref:`StringName` = &"Master"\ ) :ref:`🔗` Play an :ref:`AudioStream` at a given offset, volume, pitch scale, playback type, and bus. Playback starts immediately. The return value is a 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()` is called. This function returns :ref:`INVALID_ID` if the amount of streams currently playing equals :ref:`AudioStreamPolyphonic.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**\ (\ stream\: :ref:`int`, pitch_scale\: :ref:`float`\ ) :ref:`🔗` Change the stream pitch scale. The ``stream`` argument is an integer ID returned by :ref:`play_stream()`. .. rst-class:: classref-item-separator ---- .. _class_AudioStreamPlaybackPolyphonic_method_set_stream_volume: .. rst-class:: classref-method |void| **set_stream_volume**\ (\ stream\: :ref:`int`, volume_db\: :ref:`float`\ ) :ref:`🔗` Change the stream volume (in db). The ``stream`` argument is an integer ID returned by :ref:`play_stream()`. .. rst-class:: classref-item-separator ---- .. _class_AudioStreamPlaybackPolyphonic_method_stop_stream: .. rst-class:: classref-method |void| **stop_stream**\ (\ stream\: :ref:`int`\ ) :ref:`🔗` Stop a stream. The ``stream`` argument is an integer ID returned by :ref:`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.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |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.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`