class_audiostream.rst 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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:`float<class_float>` | :ref:`_get_length<class_AudioStream_method__get_length>` **(** **)** |virtual| |const| |
  24. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+
  25. | :ref:`String<class_String>` | :ref:`_get_stream_name<class_AudioStream_method__get_stream_name>` **(** **)** |virtual| |const| |
  26. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+
  27. | :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`_instance_playback<class_AudioStream_method__instance_playback>` **(** **)** |virtual| |const| |
  28. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`_is_monophonic<class_AudioStream_method__is_monophonic>` **(** **)** |virtual| |const| |
  30. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+
  31. | :ref:`float<class_float>` | :ref:`get_length<class_AudioStream_method_get_length>` **(** **)** |const| |
  32. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+
  33. | :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`instance_playback<class_AudioStream_method_instance_playback>` **(** **)** |
  34. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`is_monophonic<class_AudioStream_method_is_monophonic>` **(** **)** |const| |
  36. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+
  37. Method Descriptions
  38. -------------------
  39. .. _class_AudioStream_method__get_length:
  40. - :ref:`float<class_float>` **_get_length** **(** **)** |virtual| |const|
  41. ----
  42. .. _class_AudioStream_method__get_stream_name:
  43. - :ref:`String<class_String>` **_get_stream_name** **(** **)** |virtual| |const|
  44. ----
  45. .. _class_AudioStream_method__instance_playback:
  46. - :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **_instance_playback** **(** **)** |virtual| |const|
  47. ----
  48. .. _class_AudioStream_method__is_monophonic:
  49. - :ref:`bool<class_bool>` **_is_monophonic** **(** **)** |virtual| |const|
  50. ----
  51. .. _class_AudioStream_method_get_length:
  52. - :ref:`float<class_float>` **get_length** **(** **)** |const|
  53. Returns the length of the audio stream in seconds.
  54. ----
  55. .. _class_AudioStream_method_instance_playback:
  56. - :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **instance_playback** **(** **)**
  57. Returns an AudioStreamPlayback. Useful for when you want to extend `_instance_playback` but call `instance_playback` from an internally held AudioStream subresource. An example of this can be found in the source files for `AudioStreamRandomPitch::instance_playback`.
  58. ----
  59. .. _class_AudioStream_method_is_monophonic:
  60. - :ref:`bool<class_bool>` **is_monophonic** **(** **)** |const|
  61. Returns true if this audio stream only supports monophonic playback, or false if the audio stream supports polyphony.
  62. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  63. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  64. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  65. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  66. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  67. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`