Class reference

AudioStream

Inherits Resource

Base class for audio streams.

Description

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.

Methods

int _get_bar_beats() virtual const

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

int _get_beat_count() virtual const

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

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.

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

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

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

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

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.

bool can_be_sampled() const

Experimental.

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

bool is_meta_stream() const

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

bool is_monophonic() const

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

Signals

parameter_list_changed()

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

Tutorials

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.