class_audiostreamgeneratorplayback.rst 6.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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/AudioStreamGeneratorPlayback.xml.
  6. .. _class_AudioStreamGeneratorPlayback:
  7. AudioStreamGeneratorPlayback
  8. ============================
  9. **Inherits:** :ref:`AudioStreamPlaybackResampled<class_AudioStreamPlaybackResampled>` **<** :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Plays back audio generated using :ref:`AudioStreamGenerator<class_AudioStreamGenerator>`.
  11. Description
  12. -----------
  13. This class is meant to be used with :ref:`AudioStreamGenerator<class_AudioStreamGenerator>` to play back the generated audio in real-time.
  14. Tutorials
  15. ---------
  16. - `Audio Generator Demo <https://godotengine.org/asset-library/asset/526>`__
  17. - `Godot 3.2 will get new audio features <https://godotengine.org/article/godot-32-will-get-new-audio-features>`__
  18. Methods
  19. -------
  20. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`can_push_buffer<class_AudioStreamGeneratorPlayback_method_can_push_buffer>` **(** :ref:`int<class_int>` amount **)** |const| |
  22. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`clear_buffer<class_AudioStreamGeneratorPlayback_method_clear_buffer>` **(** **)** |
  24. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`get_frames_available<class_AudioStreamGeneratorPlayback_method_get_frames_available>` **(** **)** |const| |
  26. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`get_skips<class_AudioStreamGeneratorPlayback_method_get_skips>` **(** **)** |const| |
  28. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>` **(** :ref:`PackedVector2Array<class_PackedVector2Array>` frames **)** |
  30. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` **(** :ref:`Vector2<class_Vector2>` frame **)** |
  32. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  33. Method Descriptions
  34. -------------------
  35. .. _class_AudioStreamGeneratorPlayback_method_can_push_buffer:
  36. - :ref:`bool<class_bool>` **can_push_buffer** **(** :ref:`int<class_int>` amount **)** |const|
  37. Returns ``true`` if a buffer of the size ``amount`` can be pushed to the audio sample data buffer without overflowing it, ``false`` otherwise.
  38. ----
  39. .. _class_AudioStreamGeneratorPlayback_method_clear_buffer:
  40. - void **clear_buffer** **(** **)**
  41. Clears the audio sample data buffer.
  42. ----
  43. .. _class_AudioStreamGeneratorPlayback_method_get_frames_available:
  44. - :ref:`int<class_int>` **get_frames_available** **(** **)** |const|
  45. Returns the number of audio data frames left to play. If this returned number reaches ``0``, the audio will stop playing until frames are added again. Therefore, make sure your script can always generate and push new audio frames fast enough to avoid audio cracking.
  46. ----
  47. .. _class_AudioStreamGeneratorPlayback_method_get_skips:
  48. - :ref:`int<class_int>` **get_skips** **(** **)** |const|
  49. ----
  50. .. _class_AudioStreamGeneratorPlayback_method_push_buffer:
  51. - :ref:`bool<class_bool>` **push_buffer** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` frames **)**
  52. Pushes several audio data frames to the buffer. This is usually more efficient than :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` in C# and compiled languages via GDExtension, but :ref:`push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>` may be *less* efficient in GDScript.
  53. ----
  54. .. _class_AudioStreamGeneratorPlayback_method_push_frame:
  55. - :ref:`bool<class_bool>` **push_frame** **(** :ref:`Vector2<class_Vector2>` frame **)**
  56. Pushes a single audio data frame to the buffer. This is usually less efficient than :ref:`push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>` in C# and compiled languages via GDExtension, but :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` may be *more* efficient in GDScript.
  57. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  58. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  59. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  60. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  61. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  62. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`