class_audiostreamsample.rst 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the AudioStreamSample.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_AudioStreamSample:
  5. AudioStreamSample
  6. =================
  7. **Inherits:** :ref:`AudioStream<class_AudioStream>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Plays audio.
  12. Properties
  13. ----------
  14. +--------------------------------------------------+----------------------------------------------------------------+
  15. | :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`data<class_AudioStreamSample_property_data>` |
  16. +--------------------------------------------------+----------------------------------------------------------------+
  17. | :ref:`Format<enum_AudioStreamSample_Format>` | :ref:`format<class_AudioStreamSample_property_format>` |
  18. +--------------------------------------------------+----------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`loop_begin<class_AudioStreamSample_property_loop_begin>` |
  20. +--------------------------------------------------+----------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`loop_end<class_AudioStreamSample_property_loop_end>` |
  22. +--------------------------------------------------+----------------------------------------------------------------+
  23. | :ref:`LoopMode<enum_AudioStreamSample_LoopMode>` | :ref:`loop_mode<class_AudioStreamSample_property_loop_mode>` |
  24. +--------------------------------------------------+----------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`mix_rate<class_AudioStreamSample_property_mix_rate>` |
  26. +--------------------------------------------------+----------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`stereo<class_AudioStreamSample_property_stereo>` |
  28. +--------------------------------------------------+----------------------------------------------------------------+
  29. Methods
  30. -------
  31. +------+-------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`save_to_wav<class_AudioStreamSample_method_save_to_wav>` **(** :ref:`String<class_String>` path **)** |
  33. +------+-------------------------------------------------------------------------------------------------------------+
  34. Enumerations
  35. ------------
  36. .. _enum_AudioStreamSample_Format:
  37. .. _class_AudioStreamSample_constant_FORMAT_8_BITS:
  38. .. _class_AudioStreamSample_constant_FORMAT_16_BITS:
  39. .. _class_AudioStreamSample_constant_FORMAT_IMA_ADPCM:
  40. enum **Format**:
  41. - **FORMAT_8_BITS** = **0** --- Audio codec 8 bit.
  42. - **FORMAT_16_BITS** = **1** --- Audio codec 16 bit.
  43. - **FORMAT_IMA_ADPCM** = **2** --- Audio codec IMA ADPCM.
  44. .. _enum_AudioStreamSample_LoopMode:
  45. .. _class_AudioStreamSample_constant_LOOP_DISABLED:
  46. .. _class_AudioStreamSample_constant_LOOP_FORWARD:
  47. .. _class_AudioStreamSample_constant_LOOP_PING_PONG:
  48. .. _class_AudioStreamSample_constant_LOOP_BACKWARD:
  49. enum **LoopMode**:
  50. - **LOOP_DISABLED** = **0** --- Audio does not loop.
  51. - **LOOP_FORWARD** = **1** --- Audio loops the data between loop_begin and loop_end playing forward only.
  52. - **LOOP_PING_PONG** = **2** --- Audio loops the data between loop_begin and loop_end playing back and forth.
  53. - **LOOP_BACKWARD** = **3** --- Audio loops the data between loop_begin and loop_end playing backward only.
  54. Description
  55. -----------
  56. Plays audio, can loop.
  57. Property Descriptions
  58. ---------------------
  59. .. _class_AudioStreamSample_property_data:
  60. - :ref:`PoolByteArray<class_PoolByteArray>` **data**
  61. +----------+-----------------+
  62. | *Setter* | set_data(value) |
  63. +----------+-----------------+
  64. | *Getter* | get_data() |
  65. +----------+-----------------+
  66. Contains the audio data in bytes.
  67. .. _class_AudioStreamSample_property_format:
  68. - :ref:`Format<enum_AudioStreamSample_Format>` **format**
  69. +----------+-------------------+
  70. | *Setter* | set_format(value) |
  71. +----------+-------------------+
  72. | *Getter* | get_format() |
  73. +----------+-------------------+
  74. Audio format. See FORMAT\_\* constants for values.
  75. .. _class_AudioStreamSample_property_loop_begin:
  76. - :ref:`int<class_int>` **loop_begin**
  77. +----------+-----------------------+
  78. | *Setter* | set_loop_begin(value) |
  79. +----------+-----------------------+
  80. | *Getter* | get_loop_begin() |
  81. +----------+-----------------------+
  82. Loop start in bytes.
  83. .. _class_AudioStreamSample_property_loop_end:
  84. - :ref:`int<class_int>` **loop_end**
  85. +----------+---------------------+
  86. | *Setter* | set_loop_end(value) |
  87. +----------+---------------------+
  88. | *Getter* | get_loop_end() |
  89. +----------+---------------------+
  90. Loop end in bytes.
  91. .. _class_AudioStreamSample_property_loop_mode:
  92. - :ref:`LoopMode<enum_AudioStreamSample_LoopMode>` **loop_mode**
  93. +----------+----------------------+
  94. | *Setter* | set_loop_mode(value) |
  95. +----------+----------------------+
  96. | *Getter* | get_loop_mode() |
  97. +----------+----------------------+
  98. Loop mode. See LOOP\_\* constants for values.
  99. .. _class_AudioStreamSample_property_mix_rate:
  100. - :ref:`int<class_int>` **mix_rate**
  101. +----------+---------------------+
  102. | *Setter* | set_mix_rate(value) |
  103. +----------+---------------------+
  104. | *Getter* | get_mix_rate() |
  105. +----------+---------------------+
  106. The sample rate for mixing this audio.
  107. .. _class_AudioStreamSample_property_stereo:
  108. - :ref:`bool<class_bool>` **stereo**
  109. +----------+-------------------+
  110. | *Setter* | set_stereo(value) |
  111. +----------+-------------------+
  112. | *Getter* | is_stereo() |
  113. +----------+-------------------+
  114. If ``true``, audio is stereo. Default value: ``false``.
  115. Method Descriptions
  116. -------------------
  117. .. _class_AudioStreamSample_method_save_to_wav:
  118. - void **save_to_wav** **(** :ref:`String<class_String>` path **)**