:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the AudioStream.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_AudioStream: AudioStream =========== **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`AudioStreamGenerator`, :ref:`AudioStreamMP3`, :ref:`AudioStreamMicrophone`, :ref:`AudioStreamOGGVorbis`, :ref:`AudioStreamRandomizer`, :ref:`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 :ref:`AudioStreamSample`) and OGG (via :ref:`AudioStreamOGGVorbis`) file formats. Tutorials --------- - :doc:`Audio streams <../tutorials/audio/audio_streams>` - `Audio Generator Demo `__ - `Audio Mic Record Demo `__ - `Audio Spectrum Demo `__ Methods ------- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`_get_length` **(** **)** |virtual| |const| | +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`_get_stream_name` **(** **)** |virtual| |const| | +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+ | :ref:`AudioStreamPlayback` | :ref:`_instance_playback` **(** **)** |virtual| |const| | +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_is_monophonic` **(** **)** |virtual| |const| | +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_length` **(** **)** |const| | +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+ | :ref:`AudioStreamPlayback` | :ref:`instance_playback` **(** **)** | +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_monophonic` **(** **)** |const| | +-------------------------------------------------------+------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- .. _class_AudioStream_method__get_length: - :ref:`float` **_get_length** **(** **)** |virtual| |const| ---- .. _class_AudioStream_method__get_stream_name: - :ref:`String` **_get_stream_name** **(** **)** |virtual| |const| ---- .. _class_AudioStream_method__instance_playback: - :ref:`AudioStreamPlayback` **_instance_playback** **(** **)** |virtual| |const| ---- .. _class_AudioStream_method__is_monophonic: - :ref:`bool` **_is_monophonic** **(** **)** |virtual| |const| ---- .. _class_AudioStream_method_get_length: - :ref:`float` **get_length** **(** **)** |const| Returns the length of the audio stream in seconds. ---- .. _class_AudioStream_method_instance_playback: - :ref:`AudioStreamPlayback` **instance_playback** **(** **)** 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`. ---- .. _class_AudioStream_method_is_monophonic: - :ref:`bool` **is_monophonic** **(** **)** |const| Returns true if this audio stream only supports monophonic playback, or false if the audio stream supports polyphony. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`