Class AudioStreamRandomizer
- Namespace
- Godot
- Assembly
- GodotSharp.dll
Picks a random AudioStream from the pool, depending on the playback mode, and applies random pitch shifting and volume shifting during playback.
public class AudioStreamRandomizer : AudioStream, IDisposable
- Inheritance
-
AudioStreamRandomizer
- Implements
- Inherited Members
Constructors
AudioStreamRandomizer()
public AudioStreamRandomizer()
Properties
PlaybackMode
Controls how this AudioStreamRandomizer picks which AudioStream to play next.
public AudioStreamRandomizer.PlaybackModeEnum PlaybackMode { get; set; }
Property Value
RandomPitch
The intensity of random pitch variation. A value of 1 means no variation.
public float RandomPitch { get; set; }
Property Value
RandomVolumeOffsetDb
The intensity of random volume variation. A value of 0 means no variation.
public float RandomVolumeOffsetDb { get; set; }
Property Value
StreamsCount
The number of streams in the stream pool.
public int StreamsCount { get; set; }
Property Value
Methods
AddStream(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.
public void AddStream(int index, AudioStream stream, float weight = 1)
Parameters
index
intstream
AudioStreamweight
float
GetStream(int)
Returns the stream at the specified index.
public AudioStream GetStream(int index)
Parameters
index
int
Returns
GetStreamProbabilityWeight(int)
Returns the probability weight associated with the stream at the given index.
public float GetStreamProbabilityWeight(int index)
Parameters
index
int
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
MoveStream(int, int)
Move a stream from one index to another.
public void MoveStream(int indexFrom, int indexTo)
Parameters
RemoveStream(int)
Remove the stream at the specified index.
public void RemoveStream(int index)
Parameters
index
int
SetStream(int, AudioStream)
Set the AudioStream at the specified index.
public void SetStream(int index, AudioStream stream)
Parameters
index
intstream
AudioStream
SetStreamProbabilityWeight(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.
public void SetStreamProbabilityWeight(int index, float weight)