Class AudioStreamRandomizer
Wraps a pool of audio streams with pitch and volume shifting.
- Inheritance
-
AudioStreamRandomizer
Remarks
Picks a random AudioStream from the pool, depending on the playback mode, and applies random pitch shifting and volume shifting during playback.
Properties
playback_mode
Controls how this AudioStreamRandomizer picks which AudioStream to play next.
var playback_mode : int = 0
Property Value
Remarks
random_pitch
The intensity of random pitch variation. A value of 1 means no variation.
var random_pitch : float = 1.0
Property Value
Remarks
random_volume_offset_db
The intensity of random volume variation. A value of 0 means no variation.
var random_volume_offset_db : float = 0.0
Property Value
Remarks
streams_count
The number of streams in the stream pool.
var streams_count : int = 0
Property Value
Remarks
Methods
add_stream(int, AudioStream, float)
Insert a stream at the specified index. If the index is less than zero, the insertion occurs at the end of the underlying pool.
void add_stream(int index, AudioStream stream, float weight)
Parameters
index
intstream
AudioStreamweight
float
get_stream(int)
Qualifiers: const
Returns the stream at the specified index.
AudioStream get_stream(int index)
Parameters
index
int
get_stream_probability_weight(int)
Qualifiers: const
Returns the probability weight associated with the stream at the given index.
float get_stream_probability_weight(int index)
Parameters
index
int
move_stream(int, int)
Move a stream from one index to another.
void move_stream(int index_from, int index_to)
Parameters
remove_stream(int)
Remove the stream at the specified index.
void remove_stream(int index)
Parameters
index
int
set_stream(int, AudioStream)
Set the AudioStream at the specified index.
void set_stream(int index, AudioStream stream)
Parameters
index
intstream
AudioStream
set_stream_probability_weight(int, float)
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.
void set_stream_probability_weight(int index, float weight)