AudioStreamPlayer.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AudioStreamPlayer" inherits="Node" category="Core" version="3.1">
  3. <brief_description>
  4. Plays back audio.
  5. </brief_description>
  6. <description>
  7. Plays background audio.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/latest/learning/features/audio/index.html</link>
  11. <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link>
  12. </tutorials>
  13. <demos>
  14. </demos>
  15. <methods>
  16. <method name="get_playback_position">
  17. <return type="float">
  18. </return>
  19. <description>
  20. Returns the position in the [AudioStream] in seconds.
  21. </description>
  22. </method>
  23. <method name="play">
  24. <return type="void">
  25. </return>
  26. <argument index="0" name="from_position" type="float" default="0.0">
  27. </argument>
  28. <description>
  29. Plays the audio from the given position 'from_position', in seconds.
  30. </description>
  31. </method>
  32. <method name="seek">
  33. <return type="void">
  34. </return>
  35. <argument index="0" name="to_position" type="float">
  36. </argument>
  37. <description>
  38. Sets the position from which audio will be played, in seconds.
  39. </description>
  40. </method>
  41. <method name="stop">
  42. <return type="void">
  43. </return>
  44. <description>
  45. Stops the audio.
  46. </description>
  47. </method>
  48. </methods>
  49. <members>
  50. <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled">
  51. If [code]true[/code], audio plays when added to scene tree. Default value: [code]false[/code].
  52. </member>
  53. <member name="bus" type="String" setter="set_bus" getter="get_bus">
  54. Bus on which this audio is playing.
  55. </member>
  56. <member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" enum="AudioStreamPlayer.MixTarget">
  57. If the audio configuration has more than two speakers, this sets the target channels. See [code]MIX_TARGET_*[/code] constants.
  58. </member>
  59. <member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale">
  60. Changes the pitch and the tempo of the audio.
  61. </member>
  62. <member name="playing" type="bool" setter="_set_playing" getter="is_playing">
  63. If [code]true[/code], audio is playing.
  64. </member>
  65. <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream">
  66. The [AudioStream] object to be played.
  67. </member>
  68. <member name="stream_paused" type="bool" setter="set_stream_paused" getter="get_stream_paused">
  69. </member>
  70. <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db">
  71. Volume of sound, in dB.
  72. </member>
  73. </members>
  74. <signals>
  75. <signal name="finished">
  76. <description>
  77. Emitted when the audio stops playing.
  78. </description>
  79. </signal>
  80. </signals>
  81. <constants>
  82. <constant name="MIX_TARGET_STEREO" value="0" enum="MixTarget">
  83. The audio will be played only on the first channel.
  84. </constant>
  85. <constant name="MIX_TARGET_SURROUND" value="1" enum="MixTarget">
  86. The audio will be played on all surround channels.
  87. </constant>
  88. <constant name="MIX_TARGET_CENTER" value="2" enum="MixTarget">
  89. The audio will be played on the second channel, which is usually the center.
  90. </constant>
  91. </constants>
  92. </class>