AudioStreamPlayer.xml 3.0 KB

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