Table of Contents

Class AudioStream

Base class for audio streams.

Inheritance
AudioStream
Derived

Remarks

Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via AudioStreamWAV) and Ogg (via AudioStreamOggVorbis) file formats.

See Also

Methods

_get_bar_beats

Qualifiers: virtualconst

Override this method to return the bar beats of this stream.

int _get_bar_beats

_get_beat_count

Qualifiers: virtualconst

Overridable method. Should return the total number of beats of this audio stream. Used by the engine to determine the position of every beat.

Ideally, the returned value should be based off the stream's sample rate (mix_rate, for example).

int _get_beat_count

_get_bpm

Qualifiers: virtualconst

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 (mix_rate, for example).

float _get_bpm

_get_length

Qualifiers: virtualconst

Override this method to customize the returned value of get_length. Should return the length of this audio stream, in seconds.

float _get_length

_get_parameter_list

Qualifiers: virtualconst

Return the controllable parameters of this stream. This array contains dictionaries with a property info description format (see get_property_list). Additionally, the default value for this parameter must be added tho each dictionary in "default_value" field.

Dictionary[] _get_parameter_list

_get_stream_name

Qualifiers: virtualconst

Override this method to customize the name assigned to this audio stream. Unused by the engine.

String _get_stream_name

_has_loop

Qualifiers: virtualconst

Override this method to return true if this stream has a loop.

bool _has_loop

_instantiate_playback

Qualifiers: virtualconst

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).

AudioStreamPlayback _instantiate_playback

_is_monophonic

Qualifiers: virtualconst

Override this method to customize the returned value of is_monophonic. Should return true if this audio stream only supports one channel.

bool _is_monophonic

can_be_sampled

Qualifiers: const

Returns if the current AudioStream can be used as a sample. Only static streams can be sampled.

bool can_be_sampled

generate_sample

Qualifiers: const

Generates an AudioSample based on the current stream.

AudioSample generate_sample

get_length

Qualifiers: const

Returns the length of the audio stream in seconds.

float get_length

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.

AudioStreamPlayback instantiate_playback

is_meta_stream

Qualifiers: const

Returns true if the stream is a collection of other streams, false otherwise.

bool is_meta_stream

is_monophonic

Qualifiers: const

Returns true if this audio stream only supports one channel (monophony), or false if the audio stream supports two or more channels (polyphony).

bool is_monophonic

Events

parameter_list_changed

Signal to be emitted to notify when the parameter list changed.

signal parameter_list_changed