Table of Contents

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

int

Remarks

  • void set_playback_mode(int value)
  • int get_playback_mode

random_pitch

The intensity of random pitch variation. A value of 1 means no variation.

var random_pitch : float = 1.0

Property Value

float

Remarks

  • void set_random_pitch(float value)
  • float get_random_pitch

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

float

Remarks

  • void set_random_volume_offset_db(float value)
  • float get_random_volume_offset_db

streams_count

The number of streams in the stream pool.

var streams_count : int = 0

Property Value

int

Remarks

  • void set_streams_count(int value)
  • int get_streams_count

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 int
stream AudioStream
weight 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

index_from int
index_to int

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 int
stream 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)

Parameters

index int
weight float