class_audiostream.rst 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the AudioStream.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_AudioStream:
  6. AudioStream
  7. ===========
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`AudioStreamGenerator<class_AudioStreamGenerator>`, :ref:`AudioStreamMP3<class_AudioStreamMP3>`, :ref:`AudioStreamMicrophone<class_AudioStreamMicrophone>`, :ref:`AudioStreamOGGVorbis<class_AudioStreamOGGVorbis>`, :ref:`AudioStreamRandomizer<class_AudioStreamRandomizer>`, :ref:`AudioStreamSample<class_AudioStreamSample>`
  10. Base class for audio streams.
  11. Description
  12. -----------
  13. Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via :ref:`AudioStreamSample<class_AudioStreamSample>`) and OGG (via :ref:`AudioStreamOGGVorbis<class_AudioStreamOGGVorbis>`) file formats.
  14. Tutorials
  15. ---------
  16. - :doc:`Audio streams <../tutorials/audio/audio_streams>`
  17. - `Audio Generator Demo <https://godotengine.org/asset-library/asset/526>`__
  18. - `Audio Mic Record Demo <https://godotengine.org/asset-library/asset/527>`__
  19. - `Audio Spectrum Demo <https://godotengine.org/asset-library/asset/528>`__
  20. Methods
  21. -------
  22. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`_get_beat_count<class_AudioStream_method__get_beat_count>` **(** **)** |virtual| |const| |
  24. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  25. | :ref:`float<class_float>` | :ref:`_get_bpm<class_AudioStream_method__get_bpm>` **(** **)** |virtual| |const| |
  26. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`_get_length<class_AudioStream_method__get_length>` **(** **)** |virtual| |const| |
  28. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  29. | :ref:`String<class_String>` | :ref:`_get_stream_name<class_AudioStream_method__get_stream_name>` **(** **)** |virtual| |const| |
  30. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  31. | :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`_instantiate_playback<class_AudioStream_method__instantiate_playback>` **(** **)** |virtual| |const| |
  32. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`_is_monophonic<class_AudioStream_method__is_monophonic>` **(** **)** |virtual| |const| |
  34. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  35. | :ref:`float<class_float>` | :ref:`get_length<class_AudioStream_method_get_length>` **(** **)** |const| |
  36. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  37. | :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`instantiate_playback<class_AudioStream_method_instantiate_playback>` **(** **)** |
  38. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`is_monophonic<class_AudioStream_method_is_monophonic>` **(** **)** |const| |
  40. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  41. Method Descriptions
  42. -------------------
  43. .. _class_AudioStream_method__get_beat_count:
  44. - :ref:`int<class_int>` **_get_beat_count** **(** **)** |virtual| |const|
  45. ----
  46. .. _class_AudioStream_method__get_bpm:
  47. - :ref:`float<class_float>` **_get_bpm** **(** **)** |virtual| |const|
  48. ----
  49. .. _class_AudioStream_method__get_length:
  50. - :ref:`float<class_float>` **_get_length** **(** **)** |virtual| |const|
  51. ----
  52. .. _class_AudioStream_method__get_stream_name:
  53. - :ref:`String<class_String>` **_get_stream_name** **(** **)** |virtual| |const|
  54. ----
  55. .. _class_AudioStream_method__instantiate_playback:
  56. - :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **_instantiate_playback** **(** **)** |virtual| |const|
  57. ----
  58. .. _class_AudioStream_method__is_monophonic:
  59. - :ref:`bool<class_bool>` **_is_monophonic** **(** **)** |virtual| |const|
  60. ----
  61. .. _class_AudioStream_method_get_length:
  62. - :ref:`float<class_float>` **get_length** **(** **)** |const|
  63. Returns the length of the audio stream in seconds.
  64. ----
  65. .. _class_AudioStream_method_instantiate_playback:
  66. - :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **instantiate_playback** **(** **)**
  67. Returns an AudioStreamPlayback. Useful for when you want to extend :ref:`_instantiate_playback<class_AudioStream_method__instantiate_playback>` but call :ref:`instantiate_playback<class_AudioStream_method_instantiate_playback>` from an internally held AudioStream subresource. An example of this can be found in the source files for ``AudioStreamRandomPitch::instantiate_playback``.
  68. ----
  69. .. _class_AudioStream_method_is_monophonic:
  70. - :ref:`bool<class_bool>` **is_monophonic** **(** **)** |const|
  71. Returns true if this audio stream only supports monophonic playback, or false if the audio stream supports polyphony.
  72. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  73. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  74. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  75. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  76. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  77. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`