class_audiostreamplayer.rst 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer_get_playback_position>` **(** **)** |
  16. +----------------------------+---------------------------------------------------------------------------------------------------+
  17. | void | :ref:`play<class_AudioStreamPlayer_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
  18. +----------------------------+---------------------------------------------------------------------------------------------------+
  19. | void | :ref:`seek<class_AudioStreamPlayer_seek>` **(** :ref:`float<class_float>` to_position **)** |
  20. +----------------------------+---------------------------------------------------------------------------------------------------+
  21. | void | :ref:`stop<class_AudioStreamPlayer_stop>` **(** **)** |
  22. +----------------------------+---------------------------------------------------------------------------------------------------+
  23. Signals
  24. -------
  25. .. _class_AudioStreamPlayer_finished:
  26. - **finished** **(** **)**
  27. Emitted when the audio stops playing.
  28. Member Variables
  29. ----------------
  30. .. _class_AudioStreamPlayer_autoplay:
  31. - :ref:`bool<class_bool>` **autoplay** - If ``true`` audio plays when added to scene tree. Default value: ``false``.
  32. .. _class_AudioStreamPlayer_bus:
  33. - :ref:`String<class_string>` **bus** - Bus on which this audio is playing.
  34. .. _class_AudioStreamPlayer_mix_target:
  35. - :ref:`MixTarget<enum_audiostreamplayer_mixtarget>` **mix_target** - If the audio configuration has more than two speakers, this sets the target channels. See ``MIX_TARGET_*`` constants.
  36. .. _class_AudioStreamPlayer_playing:
  37. - :ref:`bool<class_bool>` **playing** - If ``true`` audio is playing.
  38. .. _class_AudioStreamPlayer_stream:
  39. - :ref:`AudioStream<class_audiostream>` **stream** - The :ref:`AudioStream<class_audiostream>` object to be played.
  40. .. _class_AudioStreamPlayer_volume_db:
  41. - :ref:`float<class_float>` **volume_db** - Volume of sound, in dB.
  42. Enums
  43. -----
  44. .. _enum_AudioStreamPlayer_MixTarget:
  45. enum **MixTarget**
  46. - **MIX_TARGET_STEREO** = **0** --- The audio will be played only on the first channel.
  47. - **MIX_TARGET_SURROUND** = **1** --- The audio will be played on all surround channels.
  48. - **MIX_TARGET_CENTER** = **2** --- The audio will be played on the second channel, which is usually the center.
  49. Description
  50. -----------
  51. Plays background audio.
  52. Member Function Description
  53. ---------------------------
  54. .. _class_AudioStreamPlayer_get_playback_position:
  55. - :ref:`float<class_float>` **get_playback_position** **(** **)**
  56. Returns the position in the :ref:`AudioStream<class_audiostream>`.
  57. .. _class_AudioStreamPlayer_play:
  58. - void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  59. Plays the audio from the given position 'from_position', in seconds.
  60. .. _class_AudioStreamPlayer_seek:
  61. - void **seek** **(** :ref:`float<class_float>` to_position **)**
  62. Sets the position from which audio will be played, in seconds.
  63. .. _class_AudioStreamPlayer_stop:
  64. - void **stop** **(** **)**
  65. Stops the audio.