Debian Codegraph @

doc/classes/AudioStreamRandomizer.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <class name="AudioStreamRandomizer" inherits="AudioStream" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
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 <param index="0" name="index" type="int" />
15 <param index="1" name="stream" type="AudioStream" />
16 <param index="2" name="weight" type="float" default="1.0" />
17 <description>
18 Insert a stream at the specified index. If the index is less than zero, the insertion occurs at the end of the underlying pool.
19 </description>
20 </method>
21 <method name="get_stream" qualifiers="const">
22 <return type="AudioStream" />
23 <param index="0" name="index" type="int" />
24 <description>
25 Returns the stream at the specified index.
26 </description>
27 </method>
28 <method name="get_stream_probability_weight" qualifiers="const">
29 <return type="float" />
30 <param index="0" name="index" type="int" />
31 <description>
32 Returns the probability weight associated with the stream at the given index.
33 </description>
34 </method>
35 <method name="move_stream">
36 <return type="void" />
37 <param index="0" name="index_from" type="int" />
38 <param index="1" name="index_to" type="int" />
39 <description>
40 Move a stream from one index to another.
41 </description>
42 </method>
43 <method name="remove_stream">
44 <return type="void" />
45 <param index="0" name="index" type="int" />
46 <description>
47 Remove the stream at the specified index.
48 </description>
49 </method>
50 <method name="set_stream">
51 <return type="void" />
52 <param index="0" name="index" type="int" />
53 <param index="1" name="stream" type="AudioStream" />
54 <description>
55 Set the AudioStream at the specified index.
56 </description>
57 </method>
58 <method name="set_stream_probability_weight">
59 <return type="void" />
60 <param index="0" name="index" type="int" />
61 <param index="1" name="weight" type="float" />
62 <description>
63 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.
64 </description>
65 </method>
66 </methods>
67 <members>
68 <member name="playback_mode" type="int" setter="set_playback_mode" getter="get_playback_mode" enum="AudioStreamRandomizer.PlaybackMode" default="0">
69 Controls how this AudioStreamRandomizer picks which AudioStream to play next.
70 </member>
71 <member name="random_pitch" type="float" setter="set_random_pitch" getter="get_random_pitch" default="1.0">
72 The largest possible frequency multiplier of the random pitch variation. Pitch will be randomly chosen within a range of [code skip-lint]1.0 / random_pitch[/code] and [code skip-lint]random_pitch[/code]. A value of [code]1.0[/code] means no variation. A value of [code]2.0[/code] means pitch will be randomized between double and half.
73 [b]Note:[/b] Setting this property also sets [member random_pitch_semitones].
74 </member>
75 <member name="random_pitch_semitones" type="float" setter="set_random_pitch_semitones" getter="get_random_pitch_semitones" default="0.0">
76 The largest possible distance, in semitones, of the random pitch variation. A value of [code]0.0[/code] means no variation.
77 [b]Note:[/b] Setting this property also sets [member random_pitch].
78 </member>
79 <member name="random_volume_offset_db" type="float" setter="set_random_volume_offset_db" getter="get_random_volume_offset_db" default="0.0">
80 The intensity of random volume variation. Volume will be increased or decreased by a random value up to [code skip-lint]random_volume_offset_db[/code]. A value of [code]0.0[/code] means no variation. A value of [code]3.0[/code] means volume will be randomized between [code]-3.0 dB[/code] and [code]+3.0 dB[/code].
81 </member>
82 <member name="streams_count" type="int" setter="set_streams_count" getter="get_streams_count" default="0">
83 The number of streams in the stream pool.
84 </member>
85 </members>
86 <constants>
87 <constant name="PLAYBACK_RANDOM_NO_REPEATS" value="0" enum="PlaybackMode">
88 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. If only 1 sound is present in the pool, the same sound will always play, effectively allowing repeats to occur.
89 </constant>
90 <constant name="PLAYBACK_RANDOM" value="1" enum="PlaybackMode">
91 Pick a stream at random according to the probability weights chosen for each stream. If only 1 sound is present in the pool, the same sound will always play.
92 </constant>
93 <constant name="PLAYBACK_SEQUENTIAL" value="2" enum="PlaybackMode">
94 Play streams in the order they appear in the stream pool. If only 1 sound is present in the pool, the same sound will always play.
95 </constant>
96 </constants>
97 </class>