AudioStreamRandomizer.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AudioStreamRandomizer" inherits="AudioStream" version="4.0">
  3. <brief_description>
  4. Wraps a pool of audio streams with pitch and volume shifting.
  5. </brief_description>
  6. <description>
  7. Picks a random AudioStream from the pool, depending on the playback mode, and applies random pitch shifting and volume shifting during playback.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_stream">
  13. <return type="void" />
  14. <argument index="0" name="index" type="int" />
  15. <description>
  16. Insert a stream at the specified index.
  17. </description>
  18. </method>
  19. <method name="get_stream" qualifiers="const">
  20. <return type="AudioStream" />
  21. <argument index="0" name="index" type="int" />
  22. <description>
  23. Returns the stream at the specified index.
  24. </description>
  25. </method>
  26. <method name="get_stream_probability_weight" qualifiers="const">
  27. <return type="float" />
  28. <argument index="0" name="index" type="int" />
  29. <description>
  30. Returns the probability weight associated with the stream at the given index.
  31. </description>
  32. </method>
  33. <method name="move_stream">
  34. <return type="void" />
  35. <argument index="0" name="index_from" type="int" />
  36. <argument index="1" name="index_to" type="int" />
  37. <description>
  38. Move a stream from one index to another.
  39. </description>
  40. </method>
  41. <method name="remove_stream">
  42. <return type="void" />
  43. <argument index="0" name="index" type="int" />
  44. <description>
  45. Remove the stream at the specified index.
  46. </description>
  47. </method>
  48. <method name="set_stream">
  49. <return type="void" />
  50. <argument index="0" name="index" type="int" />
  51. <argument index="1" name="stream" type="AudioStream" />
  52. <description>
  53. Set the AudioStream at the specified index.
  54. </description>
  55. </method>
  56. <method name="set_stream_probability_weight">
  57. <return type="void" />
  58. <argument index="0" name="index" type="int" />
  59. <argument index="1" name="weight" type="float" />
  60. <description>
  61. Set the probability weight of the stream at the specified index. The higher this value, the more likely that the randomizer will choose this stream during random playback modes.
  62. </description>
  63. </method>
  64. </methods>
  65. <members>
  66. <member name="playback_mode" type="int" setter="set_playback_mode" getter="get_playback_mode" enum="AudioStreamRandomizer.PlaybackMode" default="0">
  67. Controls how this AudioStreamRandomizer picks which AudioStream to play next.
  68. </member>
  69. <member name="random_pitch" type="float" setter="set_random_pitch" getter="get_random_pitch" default="1.1">
  70. The intensity of random pitch variation. A value of 1 means no variation.
  71. </member>
  72. <member name="random_volume_offset_db" type="float" setter="set_random_volume_offset_db" getter="get_random_volume_offset_db" default="5.0">
  73. The intensity of random volume variation. A value of 0 means no variation.
  74. </member>
  75. <member name="streams_count" type="int" setter="set_streams_count" getter="get_streams_count" default="0">
  76. The number of streams in the stream pool.
  77. </member>
  78. </members>
  79. <constants>
  80. <constant name="PLAYBACK_RANDOM_NO_REPEATS" value="0" enum="PlaybackMode">
  81. Pick a stream at random according to the probability weights chosen for each stream, but avoid playing the same stream twice in a row whenever possible.
  82. </constant>
  83. <constant name="PLAYBACK_RANDOM" value="1" enum="PlaybackMode">
  84. Pick a stream at random according to the probability weights chosen for each stream.
  85. </constant>
  86. <constant name="PLAYBACK_SEQUENTIAL" value="2" enum="PlaybackMode">
  87. Play streams in the order they appear in the stream pool.
  88. </constant>
  89. </constants>
  90. </class>