AudioStream
Hereda: Resource < RefCounted < Object
Heredado por: AudioStreamGenerator, AudioStreamInteractive, AudioStreamMicrophone, AudioStreamMP3, AudioStreamOggVorbis, AudioStreamPlaylist, AudioStreamPolyphonic, AudioStreamRandomizer, AudioStreamSynchronized, AudioStreamWAV
Clase base para las transmisiones de audio.
Descripción
Clase base para transmisiones de audio. Las transmisiones de audio se utilizan para efectos de sonido y reproducción de música, y admiten los formatos de archivo WAV (mediante AudioStreamWAV) y Ogg (mediante AudioStreamOggVorbis).
Tutoriales
Métodos
_get_bar_beats() virtual const |
|
_get_beat_count() virtual const |
|
_get_bpm() virtual const |
|
_get_length() virtual const |
|
_get_parameter_list() virtual const |
|
_get_stream_name() virtual const |
|
_get_tags() virtual const |
|
_has_loop() virtual const |
|
_instantiate_playback() virtual required const |
|
_is_monophonic() virtual const |
|
can_be_sampled() const |
|
generate_sample() const |
|
get_length() const |
|
is_meta_stream() const |
|
is_monophonic() const |
Señales
parameter_list_changed() 🔗
Señal a emitir para notificar cuando se modifica la lista de parámetros.
Descripciones de Métodos
int _get_bar_beats() virtual const 🔗
Sobrescribe este método para devolver los compases de esta transmisión.
int _get_beat_count() virtual const 🔗
Método sobrescribible. Debe devolver el número total de pulsos de esta secuencia de audio. El motor lo utiliza para determinar la posición de cada pulso.
Idealmente, el valor devuelto debería basarse en la frecuencia de muestreo de la secuencia (por ejemplo, AudioStreamWAV.mix_rate).
float _get_bpm() virtual const 🔗
Overridable method. Should return the tempo of this audio stream, in beats per minute (BPM). Used by the engine to determine the position of every beat.
Ideally, the returned value should be based off the stream's sample rate (AudioStreamWAV.mix_rate, for example).
float _get_length() virtual const 🔗
Override this method to customize the returned value of get_length(). Should return the length of this audio stream, in seconds.
Array[Dictionary] _get_parameter_list() virtual const 🔗
Return the controllable parameters of this stream. This array contains dictionaries with a property info description format (see Object.get_property_list()). Additionally, the default value for this parameter must be added tho each dictionary in "default_value" field.
String _get_stream_name() virtual const 🔗
Sobrescribe este método para proporcionar el nombre que aparecerá en el menú de visibilidad del gizmo.
Dictionary _get_tags() virtual const 🔗
Override this method to customize the tags for this audio stream. Should return a Dictionary of strings with the tag as the key and its content as the value.
Commonly used tags include title, artist, album, tracknumber, and date.
bool _has_loop() virtual const 🔗
Sobrescribe este método para devolver true si esta secuencia tiene un bucle.
AudioStreamPlayback _instantiate_playback() virtual required const 🔗
Override this method to customize the returned value of instantiate_playback(). Should return a new AudioStreamPlayback created when the stream is played (such as by an AudioStreamPlayer).
bool _is_monophonic() virtual const 🔗
Override this method to customize the returned value of is_monophonic(). Should return true if this audio stream only supports one channel.
Experimental: Este método podría ser modificado o eliminado en versiones futuras.
Returns if the current AudioStream can be used as a sample. Only static streams can be sampled.
AudioSample generate_sample() const 🔗
Experimental: Este método podría ser modificado o eliminado en versiones futuras.
Genera un AudioSample basado en la transmisión actual.
Returns the length of the audio stream in seconds. If this stream is an AudioStreamRandomizer, returns the length of the last played stream. If this stream has an indefinite length (such as for AudioStreamGenerator and AudioStreamMicrophone), returns 0.0.
AudioStreamPlayback instantiate_playback() 🔗
Returns a newly created AudioStreamPlayback intended to play this audio stream. Useful for when you want to extend _instantiate_playback() but call instantiate_playback() from an internally held AudioStream subresource. An example of this can be found in the source code for AudioStreamRandomPitch::instantiate_playback.
Devuelve true si la transmisión es una colección de otras transmisiones, false en caso contrario.
Returns true if this audio stream only supports one channel (monophony), or false if the audio stream supports two or more channels (polyphony).