AudioStreamPlayback.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AudioStreamPlayback" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. Meta class for playing back audio.
  5. </brief_description>
  6. <description>
  7. Can play, loop, pause a scroll through audio. See [AudioStream] and [AudioStreamOggVorbis] for usage.
  8. </description>
  9. <tutorials>
  10. <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/2759</link>
  11. </tutorials>
  12. <methods>
  13. <method name="_get_loop_count" qualifiers="virtual const">
  14. <return type="int" />
  15. <description>
  16. Overridable method. Should return how many times this audio stream has looped. Most built-in playbacks always return [code]0[/code].
  17. </description>
  18. </method>
  19. <method name="_get_parameter" qualifiers="virtual const">
  20. <return type="Variant" />
  21. <param index="0" name="name" type="StringName" />
  22. <description>
  23. Return the current value of a playback parameter by name (see [method AudioStream._get_parameter_list]).
  24. </description>
  25. </method>
  26. <method name="_get_playback_position" qualifiers="virtual const">
  27. <return type="float" />
  28. <description>
  29. Overridable method. Should return the current progress along the audio stream, in seconds.
  30. </description>
  31. </method>
  32. <method name="_is_playing" qualifiers="virtual const">
  33. <return type="bool" />
  34. <description>
  35. Overridable method. Should return [code]true[/code] if this playback is active and playing its audio stream.
  36. </description>
  37. </method>
  38. <method name="_mix" qualifiers="virtual">
  39. <return type="int" />
  40. <param index="0" name="buffer" type="AudioFrame*" />
  41. <param index="1" name="rate_scale" type="float" />
  42. <param index="2" name="frames" type="int" />
  43. <description>
  44. Override this method to customize how the audio stream is mixed. This method is called even if the playback is not active.
  45. [b]Note:[/b] It is not useful to override this method in GDScript or C#. Only GDExtension can take advantage of it.
  46. </description>
  47. </method>
  48. <method name="_seek" qualifiers="virtual">
  49. <return type="void" />
  50. <param index="0" name="position" type="float" />
  51. <description>
  52. Override this method to customize what happens when seeking this audio stream at the given [param position], such as by calling [method AudioStreamPlayer.seek].
  53. </description>
  54. </method>
  55. <method name="_set_parameter" qualifiers="virtual">
  56. <return type="void" />
  57. <param index="0" name="name" type="StringName" />
  58. <param index="1" name="value" type="Variant" />
  59. <description>
  60. Set the current value of a playback parameter by name (see [method AudioStream._get_parameter_list]).
  61. </description>
  62. </method>
  63. <method name="_start" qualifiers="virtual">
  64. <return type="void" />
  65. <param index="0" name="from_pos" type="float" />
  66. <description>
  67. Override this method to customize what happens when the playback starts at the given position, such as by calling [method AudioStreamPlayer.play].
  68. </description>
  69. </method>
  70. <method name="_stop" qualifiers="virtual">
  71. <return type="void" />
  72. <description>
  73. Override this method to customize what happens when the playback is stopped, such as by calling [method AudioStreamPlayer.stop].
  74. </description>
  75. </method>
  76. <method name="_tag_used_streams" qualifiers="virtual">
  77. <return type="void" />
  78. <description>
  79. Overridable method. Called whenever the audio stream is mixed if the playback is active and [method AudioServer.set_enable_tagging_used_audio_streams] has been set to [code]true[/code]. Editor plugins may use this method to "tag" the current position along the audio stream and display it in a preview.
  80. </description>
  81. </method>
  82. <method name="get_sample_playback" qualifiers="const" experimental="">
  83. <return type="AudioSamplePlayback" />
  84. <description>
  85. Returns the [AudioSamplePlayback] associated with this [AudioStreamPlayback] for playing back the audio sample of this stream.
  86. </description>
  87. </method>
  88. <method name="set_sample_playback" experimental="">
  89. <return type="void" />
  90. <param index="0" name="playback_sample" type="AudioSamplePlayback" />
  91. <description>
  92. Associates [AudioSamplePlayback] to this [AudioStreamPlayback] for playing back the audio sample of this stream.
  93. </description>
  94. </method>
  95. </methods>
  96. </class>