Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

AudioStreamRandomizer

Eredita: AudioStream < Resource < RefCounted < Object

Incorpora un'insieme di flussi audio con spostamento del tono e del volume.

Descrizione

Sceglie un AudioStream casuale dal pool, a seconda della modalità di riproduzione, e applica una variazione casuale del tono e del volume durante la riproduzione.

Tutorial

Proprietà

PlaybackMode

playback_mode

0

float

random_pitch

1.0

float

random_pitch_semitones

0.0

float

random_volume_offset_db

0.0

AudioStream

stream_{index}/stream

float

stream_{index}/weight

1.0

int

streams_count

0

Metodi

void

add_stream(index: int, stream: AudioStream, weight: float = 1.0)

AudioStream

get_stream(index: int) const

float

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)


Enumerazioni

enum PlaybackMode: 🔗

PlaybackMode PLAYBACK_RANDOM_NO_REPEATS = 0

Sceglie un flusso a caso in base ai pesi di probabilità scelti per ciascuno flusso, ma evita di riprodurre lo stesso flusso due volte consecutive quando possibile. Se nel pool è presente solo 1 suono, verrà riprodotto sempre lo stesso suono, consentendo effettivamente le ripetizioni.

PlaybackMode PLAYBACK_RANDOM = 1

Sceglie un flusso a caso in base ai pesi di probabilità scelti per ciascun flusso. Se nel pool è presente solo 1 suono, verrà riprodotto sempre lo stesso suono.

PlaybackMode PLAYBACK_SEQUENTIAL = 2

Riproduce i flussi nell'ordine in cui appaiono nel pool di flussi. Se nel pool è presente solo 1 suono, verrà riprodotto sempre lo stesso suono.


Descrizioni delle proprietà

PlaybackMode playback_mode = 0 🔗

Controlla il modo in cui l'AudioStreamRandomizer sceglie quale AudioStream riprodurre successivamente.


float random_pitch = 1.0 🔗

  • void set_random_pitch(value: float)

  • float get_random_pitch()

The largest possible frequency multiplier of the random pitch variation. Pitch will be randomly chosen within a range of 1.0 / random_pitch and random_pitch. A value of 1.0 means no variation. A value of 2.0 means pitch will be randomized between double and half.

Note: Setting this property also sets random_pitch_semitones.


float random_pitch_semitones = 0.0 🔗

  • void set_random_pitch_semitones(value: float)

  • float get_random_pitch_semitones()

The largest possible distance, in semitones, of the random pitch variation. A value of 0.0 means no variation.

Note: Setting this property also sets random_pitch.


float random_volume_offset_db = 0.0 🔗

  • void set_random_volume_offset_db(value: float)

  • float get_random_volume_offset_db()

The intensity of random volume variation. Volume will be increased or decreased by a random value up to random_volume_offset_db. A value of 0.0 means no variation. A value of 3.0 means volume will be randomized between -3.0 dB and +3.0 dB.


AudioStream stream_{index}/stream 🔗

The AudioStream at index.

Note: index is a value in the 0 .. streams_count - 1 range.


float stream_{index}/weight = 1.0 🔗

The probability weight of the AudioStream at index.

Note: index is a value in the 0 .. streams_count - 1 range.


int streams_count = 0 🔗

  • void set_streams_count(value: int)

  • int get_streams_count()

Il numero di flussi disponibili nell'insieme di flussi.


Descrizioni dei metodi

void add_stream(index: int, stream: AudioStream, weight: float = 1.0) 🔗

Inserisci un flusso nell'indice specificato. Se l'indice è minore di zero, l'inserimento avviene alla fine del pool sottostante.


AudioStream get_stream(index: int) const 🔗

Restituisce il flusso all'indice specificato.


float get_stream_probability_weight(index: int) const 🔗

Restituisce il peso di probabilità associato con il flusso all'indice indicato.


void move_stream(index_from: int, index_to: int) 🔗

Sposta un flusso da un indice all'altro.


void remove_stream(index: int) 🔗

Rimuove il flusso all'indice specificato.


void set_stream(index: int, stream: AudioStream) 🔗

Imposta l'AudioStream all'indice specificato.


void set_stream_probability_weight(index: int, weight: float) 🔗

Imposta il peso di probabilità del flusso all'indice specificato. Più è alto questo valore, maggiore è la probabilità che il randomizzatore scelga questo flusso durante le modalità di riproduzione casuale.