class_audiostreamplaybackpolyphonic.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioStreamPlaybackPolyphonic.xml.
  6. .. _class_AudioStreamPlaybackPolyphonic:
  7. AudioStreamPlaybackPolyphonic
  8. =============================
  9. **Inherits:** :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Playback instance for :ref:`AudioStreamPolyphonic<class_AudioStreamPolyphonic>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. .. rst-class:: classref-reftable-group
  16. Methods
  17. -------
  18. .. table::
  19. :widths: auto
  20. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`is_stream_playing<class_AudioStreamPlaybackPolyphonic_method_is_stream_playing>`\ (\ stream\: :ref:`int<class_int>`\ ) |const| |
  22. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>`\ (\ stream\: :ref:`AudioStream<class_AudioStream>`, from_offset\: :ref:`float<class_float>` = 0, volume_db\: :ref:`float<class_float>` = 0, pitch_scale\: :ref:`float<class_float>` = 1.0, playback_type\: :ref:`PlaybackType<enum_AudioServer_PlaybackType>` = 0, bus\: :ref:`StringName<class_StringName>` = &"Master"\ ) |
  24. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | |void| | :ref:`set_stream_pitch_scale<class_AudioStreamPlaybackPolyphonic_method_set_stream_pitch_scale>`\ (\ stream\: :ref:`int<class_int>`, pitch_scale\: :ref:`float<class_float>`\ ) |
  26. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | |void| | :ref:`set_stream_volume<class_AudioStreamPlaybackPolyphonic_method_set_stream_volume>`\ (\ stream\: :ref:`int<class_int>`, volume_db\: :ref:`float<class_float>`\ ) |
  28. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | |void| | :ref:`stop_stream<class_AudioStreamPlaybackPolyphonic_method_stop_stream>`\ (\ stream\: :ref:`int<class_int>`\ ) |
  30. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. .. rst-class:: classref-section-separator
  32. ----
  33. .. rst-class:: classref-descriptions-group
  34. Constants
  35. ---------
  36. .. _class_AudioStreamPlaybackPolyphonic_constant_INVALID_ID:
  37. .. rst-class:: classref-constant
  38. **INVALID_ID** = ``-1`` :ref:`🔗<class_AudioStreamPlaybackPolyphonic_constant_INVALID_ID>`
  39. Returned by :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>` in case it could not allocate a stream for playback.
  40. .. rst-class:: classref-section-separator
  41. ----
  42. .. rst-class:: classref-descriptions-group
  43. Method Descriptions
  44. -------------------
  45. .. _class_AudioStreamPlaybackPolyphonic_method_is_stream_playing:
  46. .. rst-class:: classref-method
  47. :ref:`bool<class_bool>` **is_stream_playing**\ (\ stream\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_AudioStreamPlaybackPolyphonic_method_is_stream_playing>`
  48. Returns ``true`` if the stream associated with the given integer ID is still playing. Check :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>` for information on when this ID becomes invalid.
  49. .. rst-class:: classref-item-separator
  50. ----
  51. .. _class_AudioStreamPlaybackPolyphonic_method_play_stream:
  52. .. rst-class:: classref-method
  53. :ref:`int<class_int>` **play_stream**\ (\ stream\: :ref:`AudioStream<class_AudioStream>`, from_offset\: :ref:`float<class_float>` = 0, volume_db\: :ref:`float<class_float>` = 0, pitch_scale\: :ref:`float<class_float>` = 1.0, playback_type\: :ref:`PlaybackType<enum_AudioServer_PlaybackType>` = 0, bus\: :ref:`StringName<class_StringName>` = &"Master"\ ) :ref:`🔗<class_AudioStreamPlaybackPolyphonic_method_play_stream>`
  54. Play an :ref:`AudioStream<class_AudioStream>` at a given offset, volume, pitch scale, playback type, and bus. Playback starts immediately.
  55. The return value is a unique integer ID that is associated to this playback stream and which can be used to control it.
  56. 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.
  57. 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.
  58. .. rst-class:: classref-item-separator
  59. ----
  60. .. _class_AudioStreamPlaybackPolyphonic_method_set_stream_pitch_scale:
  61. .. rst-class:: classref-method
  62. |void| **set_stream_pitch_scale**\ (\ stream\: :ref:`int<class_int>`, pitch_scale\: :ref:`float<class_float>`\ ) :ref:`🔗<class_AudioStreamPlaybackPolyphonic_method_set_stream_pitch_scale>`
  63. Change the stream pitch scale. The ``stream`` argument is an integer ID returned by :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>`.
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_AudioStreamPlaybackPolyphonic_method_set_stream_volume:
  67. .. rst-class:: classref-method
  68. |void| **set_stream_volume**\ (\ stream\: :ref:`int<class_int>`, volume_db\: :ref:`float<class_float>`\ ) :ref:`🔗<class_AudioStreamPlaybackPolyphonic_method_set_stream_volume>`
  69. Change the stream volume (in db). The ``stream`` argument is an integer ID returned by :ref:`play_stream<class_AudioStreamPlaybackPolyphonic_method_play_stream>`.
  70. .. rst-class:: classref-item-separator
  71. ----
  72. .. _class_AudioStreamPlaybackPolyphonic_method_stop_stream:
  73. .. rst-class:: classref-method
  74. |void| **stop_stream**\ (\ stream\: :ref:`int<class_int>`\ ) :ref:`🔗<class_AudioStreamPlaybackPolyphonic_method_stop_stream>`
  75. 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.
  76. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  77. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  78. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  79. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  80. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  81. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  82. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  83. .. |void| replace:: :abbr:`void (No return value.)`