class_audiostreamplayer.rst 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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_playback_position<class_AudioStreamPlayer_get_playback_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** - If the audio configuration has more than two speakers, this sets the target channels. See [code]MIX_TARGET_*[/code] constants.
  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** --- The audio will be played only on the first channel.
  60. - **MIX_TARGET_SURROUND** = **1** --- The audio will be played on all surround channels.
  61. - **MIX_TARGET_CENTER** = **2** --- The audio will be played on the second channel, which is usually the center.
  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_playback_position:
  72. - :ref:`float<class_float>` **get_playback_position** **(** **)**
  73. Returns the position in the :ref:`AudioStream<class_audiostream>`.
  74. .. _class_AudioStreamPlayer_get_stream:
  75. - :ref:`AudioStream<class_audiostream>` **get_stream** **(** **)** const
  76. .. _class_AudioStreamPlayer_get_volume_db:
  77. - :ref:`float<class_float>` **get_volume_db** **(** **)** const
  78. .. _class_AudioStreamPlayer_is_autoplay_enabled:
  79. - :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
  80. .. _class_AudioStreamPlayer_is_playing:
  81. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  82. .. _class_AudioStreamPlayer_play:
  83. - void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  84. Plays the audio from the given position 'from_position', in seconds.
  85. .. _class_AudioStreamPlayer_seek:
  86. - void **seek** **(** :ref:`float<class_float>` to_position **)**
  87. Sets the position from which audio will be played, in seconds.
  88. .. _class_AudioStreamPlayer_set_autoplay:
  89. - void **set_autoplay** **(** :ref:`bool<class_bool>` enable **)**
  90. .. _class_AudioStreamPlayer_set_bus:
  91. - void **set_bus** **(** :ref:`String<class_string>` bus **)**
  92. .. _class_AudioStreamPlayer_set_mix_target:
  93. - void **set_mix_target** **(** :ref:`int<class_int>` mix_target **)**
  94. .. _class_AudioStreamPlayer_set_stream:
  95. - void **set_stream** **(** :ref:`AudioStream<class_audiostream>` stream **)**
  96. .. _class_AudioStreamPlayer_set_volume_db:
  97. - void **set_volume_db** **(** :ref:`float<class_float>` volume_db **)**
  98. .. _class_AudioStreamPlayer_stop:
  99. - void **stop** **(** **)**
  100. Stops the audio.