class_audiostreamsample.rst 5.4 KB

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