AudioStreamPlayer.xml 3.5 KB

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