class_audiostreamplayer.rst 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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_pitch_scale:
  37. - :ref:`float<class_float>` **pitch_scale** - Changes the pitch and the tempo of the audio.
  38. .. _class_AudioStreamPlayer_playing:
  39. - :ref:`bool<class_bool>` **playing** - If ``true`` audio is playing.
  40. .. _class_AudioStreamPlayer_stream:
  41. - :ref:`AudioStream<class_audiostream>` **stream** - The :ref:`AudioStream<class_audiostream>` object to be played.
  42. .. _class_AudioStreamPlayer_volume_db:
  43. - :ref:`float<class_float>` **volume_db** - Volume of sound, in dB.
  44. Enums
  45. -----
  46. .. _enum_AudioStreamPlayer_MixTarget:
  47. enum **MixTarget**
  48. - **MIX_TARGET_STEREO** = **0** --- The audio will be played only on the first channel.
  49. - **MIX_TARGET_SURROUND** = **1** --- The audio will be played on all surround channels.
  50. - **MIX_TARGET_CENTER** = **2** --- The audio will be played on the second channel, which is usually the center.
  51. Description
  52. -----------
  53. Plays background audio.
  54. Member Function Description
  55. ---------------------------
  56. .. _class_AudioStreamPlayer_get_playback_position:
  57. - :ref:`float<class_float>` **get_playback_position** **(** **)**
  58. Returns the position in the :ref:`AudioStream<class_audiostream>`.
  59. .. _class_AudioStreamPlayer_play:
  60. - void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  61. Plays the audio from the given position 'from_position', in seconds.
  62. .. _class_AudioStreamPlayer_seek:
  63. - void **seek** **(** :ref:`float<class_float>` to_position **)**
  64. Sets the position from which audio will be played, in seconds.
  65. .. _class_AudioStreamPlayer_stop:
  66. - void **stop** **(** **)**
  67. Stops the audio.