class_audiostreamplayer.rst 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the AudioStreamPlayer.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_AudioStreamPlayer:
  5. AudioStreamPlayer
  6. =================
  7. **Inherits:** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Plays back audio.
  12. Member Functions
  13. ----------------
  14. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`String<class_string>` | :ref:`get_bus<class_AudioStreamPlayer_get_bus>` **(** **)** const |
  16. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`get_mix_target<class_AudioStreamPlayer_get_mix_target>` **(** **)** const |
  18. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`float<class_float>` | :ref:`get_position<class_AudioStreamPlayer_get_position>` **(** **)** |
  20. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`AudioStream<class_audiostream>` | :ref:`get_stream<class_AudioStreamPlayer_get_stream>` **(** **)** const |
  22. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`float<class_float>` | :ref:`get_volume_db<class_AudioStreamPlayer_get_volume_db>` **(** **)** const |
  24. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`is_autoplay_enabled<class_AudioStreamPlayer_is_autoplay_enabled>` **(** **)** |
  26. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`is_playing<class_AudioStreamPlayer_is_playing>` **(** **)** const |
  28. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`play<class_AudioStreamPlayer_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
  30. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`seek<class_AudioStreamPlayer_seek>` **(** :ref:`float<class_float>` to_position **)** |
  32. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set_autoplay<class_AudioStreamPlayer_set_autoplay>` **(** :ref:`bool<class_bool>` enable **)** |
  34. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`set_bus<class_AudioStreamPlayer_set_bus>` **(** :ref:`String<class_string>` bus **)** |
  36. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_mix_target<class_AudioStreamPlayer_set_mix_target>` **(** :ref:`int<class_int>` mix_target **)** |
  38. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`set_stream<class_AudioStreamPlayer_set_stream>` **(** :ref:`AudioStream<class_audiostream>` stream **)** |
  40. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_volume_db<class_AudioStreamPlayer_set_volume_db>` **(** :ref:`float<class_float>` volume_db **)** |
  42. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`stop<class_AudioStreamPlayer_stop>` **(** **)** |
  44. +----------------------------------------+------------------------------------------------------------------------------------------------------------------+
  45. Signals
  46. -------
  47. - **finished** **(** **)**
  48. Emitted when the audio stops playing.
  49. Member Variables
  50. ----------------
  51. - :ref:`bool<class_bool>` **autoplay** - If [code]true[/code], audio plays when added to scene tree. Default value: [code]false[/code].
  52. - :ref:`String<class_string>` **bus** - Bus on which this audio is playing.
  53. - :ref:`int<class_int>` **mix_target**
  54. - :ref:`bool<class_bool>` **playing** - If [code]true[/code], audio is playing.
  55. - :ref:`AudioStream<class_audiostream>` **stream** - The [AudioStream] object to be played.
  56. - :ref:`float<class_float>` **volume_db** - Volume of sound, in dB.
  57. Numeric Constants
  58. -----------------
  59. - **MIX_TARGET_STEREO** = **0**
  60. - **MIX_TARGET_SURROUND** = **1**
  61. - **MIX_TARGET_CENTER** = **2**
  62. Description
  63. -----------
  64. Plays background audio.
  65. Member Function Description
  66. ---------------------------
  67. .. _class_AudioStreamPlayer_get_bus:
  68. - :ref:`String<class_string>` **get_bus** **(** **)** const
  69. .. _class_AudioStreamPlayer_get_mix_target:
  70. - :ref:`int<class_int>` **get_mix_target** **(** **)** const
  71. .. _class_AudioStreamPlayer_get_position:
  72. - :ref:`float<class_float>` **get_position** **(** **)**
  73. .. _class_AudioStreamPlayer_get_stream:
  74. - :ref:`AudioStream<class_audiostream>` **get_stream** **(** **)** const
  75. .. _class_AudioStreamPlayer_get_volume_db:
  76. - :ref:`float<class_float>` **get_volume_db** **(** **)** const
  77. .. _class_AudioStreamPlayer_is_autoplay_enabled:
  78. - :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
  79. .. _class_AudioStreamPlayer_is_playing:
  80. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  81. .. _class_AudioStreamPlayer_play:
  82. - void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  83. Plays the audio from the given position 'from_position', in seconds.
  84. .. _class_AudioStreamPlayer_seek:
  85. - void **seek** **(** :ref:`float<class_float>` to_position **)**
  86. Sets the position from which audio will be played, in seconds.
  87. .. _class_AudioStreamPlayer_set_autoplay:
  88. - void **set_autoplay** **(** :ref:`bool<class_bool>` enable **)**
  89. .. _class_AudioStreamPlayer_set_bus:
  90. - void **set_bus** **(** :ref:`String<class_string>` bus **)**
  91. .. _class_AudioStreamPlayer_set_mix_target:
  92. - void **set_mix_target** **(** :ref:`int<class_int>` mix_target **)**
  93. .. _class_AudioStreamPlayer_set_stream:
  94. - void **set_stream** **(** :ref:`AudioStream<class_audiostream>` stream **)**
  95. .. _class_AudioStreamPlayer_set_volume_db:
  96. - void **set_volume_db** **(** :ref:`float<class_float>` volume_db **)**
  97. .. _class_AudioStreamPlayer_stop:
  98. - void **stop** **(** **)**
  99. Stops the audio.