AudioStreamRandomizer
Hereda: AudioStream < Resource < RefCounted < Object
Envuelve un grupo de transmisiones de audio con cambio de tono y volumen.
Descripción
Elige un AudioStream aleatorio del grupo, dependiendo del modo de reproducción, y aplica cambios aleatorios de tono y volumen durante la reproducción.
Propiedades
|
||
|
||
|
||
|
||
|
Métodos
void |
add_stream(index: int, stream: AudioStream, weight: float = 1.0) |
get_stream(index: int) const |
|
get_stream_probability_weight(index: int) const |
|
void |
move_stream(index_from: int, index_to: int) |
void |
remove_stream(index: int) |
void |
set_stream(index: int, stream: AudioStream) |
void |
set_stream_probability_weight(index: int, weight: float) |
Enumeraciones
enum PlaybackMode: 🔗
PlaybackMode PLAYBACK_RANDOM_NO_REPEATS = 0
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.
PlaybackMode PLAYBACK_RANDOM = 1
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.
PlaybackMode PLAYBACK_SEQUENTIAL = 2
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.
Descripciones de Propiedades
PlaybackMode playback_mode = 0 🔗
void set_playback_mode(value: PlaybackMode)
PlaybackMode get_playback_mode()
Controla cómo este AudioStreamRandomizer elige qué AudioStream reproducir a continuación.
El mayor multiplicador de frecuencia posible de la variación de tono aleatoria. El tono se elegirá aleatoriamente dentro de un rango de 1.0 / random_pitch y random_pitch. Un valor de 1.0 significa que no hay variación. Un valor de 2.0 significa que el tono se aleatorizará entre el doble y la mitad.
Nota: Establecer esta propiedad también establece random_pitch_semitones.
float random_pitch_semitones = 0.0 🔗
La mayor distancia posible, en semitonos, de la variación de tono aleatoria. Un valor de 0.0 significa que no hay variación.
Nota: Establecer esta propiedad también establece random_pitch.
float random_volume_offset_db = 0.0 🔗
La intensidad de la variación de volumen aleatoria. El volumen se aumentará o disminuirá en un valor aleatorio hasta random_volume_offset_db. Un valor de 0.0 significa que no hay variación. Un valor de 3.0 significa que el volumen se aleatorizará entre -3.0 dB y +3.0 dB.
The number of streams in the stream pool.
Descripciones de Métodos
void add_stream(index: int, stream: AudioStream, weight: float = 1.0) 🔗
Inserta una transmisión en el índice especificado. Si el índice es menor que cero, la inserción se produce al final del grupo subyacente.
AudioStream get_stream(index: int) const 🔗
Devuelve la transmisión en el índice especificado.
float get_stream_probability_weight(index: int) const 🔗
Devuelve el peso de probabilidad asociado con la transmisión en el índice dado.
void move_stream(index_from: int, index_to: int) 🔗
Mueve una transmisión de un índice a otro.
void remove_stream(index: int) 🔗
Elimina la transmisión en el índice especificado.
void set_stream(index: int, stream: AudioStream) 🔗
Establece el AudioStream en el índice especificado.
void set_stream_probability_weight(index: int, weight: 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.