2
0

class_audiostreamsample.rst 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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_data>` |
  16. +--------------------------------------------------+-------------------------------------------------------+
  17. | :ref:`Format<enum_AudioStreamSample_Format>` | :ref:`format<class_AudioStreamSample_format>` |
  18. +--------------------------------------------------+-------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`loop_begin<class_AudioStreamSample_loop_begin>` |
  20. +--------------------------------------------------+-------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`loop_end<class_AudioStreamSample_loop_end>` |
  22. +--------------------------------------------------+-------------------------------------------------------+
  23. | :ref:`LoopMode<enum_AudioStreamSample_LoopMode>` | :ref:`loop_mode<class_AudioStreamSample_loop_mode>` |
  24. +--------------------------------------------------+-------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`mix_rate<class_AudioStreamSample_mix_rate>` |
  26. +--------------------------------------------------+-------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`stereo<class_AudioStreamSample_stereo>` |
  28. +--------------------------------------------------+-------------------------------------------------------+
  29. Methods
  30. -------
  31. +-------+------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`save_to_wav<class_AudioStreamSample_save_to_wav>` **(** :ref:`String<class_String>` path **)** |
  33. +-------+------------------------------------------------------------------------------------------------------+
  34. Enumerations
  35. ------------
  36. .. _enum_AudioStreamSample_LoopMode:
  37. enum **LoopMode**:
  38. - **LOOP_DISABLED** = **0** --- Audio does not loop.
  39. - **LOOP_FORWARD** = **1** --- Audio loops the data between loop_begin and loop_end playing forward only.
  40. - **LOOP_PING_PONG** = **2** --- Audio loops the data between loop_begin and loop_end playing back and forth.
  41. .. _enum_AudioStreamSample_Format:
  42. enum **Format**:
  43. - **FORMAT_8_BITS** = **0** --- Audio codec 8 bit.
  44. - **FORMAT_16_BITS** = **1** --- Audio codec 16 bit.
  45. - **FORMAT_IMA_ADPCM** = **2** --- Audio codec IMA ADPCM.
  46. Description
  47. -----------
  48. Plays audio, can loop.
  49. Property Descriptions
  50. ---------------------
  51. .. _class_AudioStreamSample_data:
  52. - :ref:`PoolByteArray<class_PoolByteArray>` **data**
  53. +----------+-----------------+
  54. | *Setter* | set_data(value) |
  55. +----------+-----------------+
  56. | *Getter* | get_data() |
  57. +----------+-----------------+
  58. Contains the audio data in bytes.
  59. .. _class_AudioStreamSample_format:
  60. - :ref:`Format<enum_AudioStreamSample_Format>` **format**
  61. +----------+-------------------+
  62. | *Setter* | set_format(value) |
  63. +----------+-------------------+
  64. | *Getter* | get_format() |
  65. +----------+-------------------+
  66. Audio format. See FORMAT\_\* constants for values.
  67. .. _class_AudioStreamSample_loop_begin:
  68. - :ref:`int<class_int>` **loop_begin**
  69. +----------+-----------------------+
  70. | *Setter* | set_loop_begin(value) |
  71. +----------+-----------------------+
  72. | *Getter* | get_loop_begin() |
  73. +----------+-----------------------+
  74. Loop start in bytes.
  75. .. _class_AudioStreamSample_loop_end:
  76. - :ref:`int<class_int>` **loop_end**
  77. +----------+---------------------+
  78. | *Setter* | set_loop_end(value) |
  79. +----------+---------------------+
  80. | *Getter* | get_loop_end() |
  81. +----------+---------------------+
  82. Loop end in bytes.
  83. .. _class_AudioStreamSample_loop_mode:
  84. - :ref:`LoopMode<enum_AudioStreamSample_LoopMode>` **loop_mode**
  85. +----------+----------------------+
  86. | *Setter* | set_loop_mode(value) |
  87. +----------+----------------------+
  88. | *Getter* | get_loop_mode() |
  89. +----------+----------------------+
  90. Loop mode. See LOOP\_\* constants for values.
  91. .. _class_AudioStreamSample_mix_rate:
  92. - :ref:`int<class_int>` **mix_rate**
  93. +----------+---------------------+
  94. | *Setter* | set_mix_rate(value) |
  95. +----------+---------------------+
  96. | *Getter* | get_mix_rate() |
  97. +----------+---------------------+
  98. The sample rate for mixing this audio.
  99. .. _class_AudioStreamSample_stereo:
  100. - :ref:`bool<class_bool>` **stereo**
  101. +----------+-------------------+
  102. | *Setter* | set_stereo(value) |
  103. +----------+-------------------+
  104. | *Getter* | is_stereo() |
  105. +----------+-------------------+
  106. If ``true``, audio is stereo. Default value: ``false``.
  107. Method Descriptions
  108. -------------------
  109. .. _class_AudioStreamSample_save_to_wav:
  110. - void **save_to_wav** **(** :ref:`String<class_String>` path **)**