AudioStream

Inherits: Resource < RefCounted < Object

Inherited By: AudioStreamGenerator, AudioStreamMP3, AudioStreamMicrophone, AudioStreamOGGVorbis, AudioStreamRandomizer, AudioStreamSample

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 AudioStreamSample) and OGG (via AudioStreamOGGVorbis) file formats.

Tutorials

Methods

float

_get_length ( ) virtual const

String

_get_stream_name ( ) virtual const

AudioStreamPlayback

_instance_playback ( ) virtual const

bool

_is_monophonic ( ) virtual const

float

get_length ( ) const

AudioStreamPlayback

instance_playback ( )

bool

is_monophonic ( ) const

Method Descriptions

  • float _get_length ( ) virtual const


  • String _get_stream_name ( ) virtual const



  • bool _is_monophonic ( ) virtual const


  • float get_length ( ) const

Returns the length of the audio stream in seconds.


Returns an AudioStreamPlayback. Useful for when you want to extend _instance_playback but call instance_playback from an internally held AudioStream subresource. An example of this can be found in the source files for AudioStreamRandomPitch::instance_playback.


  • bool is_monophonic ( ) const

Returns true if this audio stream only supports monophonic playback, or false if the audio stream supports polyphony.