2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 08:08:05 +00:00
<class name= "AudioStreamPlayback" inherits= "RefCounted" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
2017-10-10 14:00:10 +00:00
Meta class for playing back audio.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2022-07-28 18:34:41 +00:00
Can play, loop, pause a scroll through audio. See [AudioStream] and [AudioStreamOggVorbis] for usage.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
2024-03-25 01:20:59 +00:00
<link title= "Audio Generator Demo" > https://godotengine.org/asset-library/asset/2759</link>
2017-09-12 20:42:36 +00:00
</tutorials>
<methods >
2021-08-23 17:53:27 +00:00
<method name= "_get_loop_count" qualifiers= "virtual const" >
<return type= "int" />
<description >
2024-01-07 16:28:48 +00:00
Overridable method. Should return how many times this audio stream has looped. Most built-in playbacks always return [code]0[/code].
2021-08-23 17:53:27 +00:00
</description>
</method>
2023-12-23 16:30:32 +00:00
<method name= "_get_parameter" qualifiers= "virtual const" >
<return type= "Variant" />
<param index= "0" name= "name" type= "StringName" />
<description >
Return the current value of a playback parameter by name (see [method AudioStream._get_parameter_list]).
</description>
</method>
2021-08-23 17:53:27 +00:00
<method name= "_get_playback_position" qualifiers= "virtual const" >
<return type= "float" />
<description >
2024-01-07 16:28:48 +00:00
Overridable method. Should return the current progress along the audio stream, in seconds.
2021-08-23 17:53:27 +00:00
</description>
</method>
<method name= "_is_playing" qualifiers= "virtual const" >
<return type= "bool" />
<description >
2024-01-07 16:28:48 +00:00
Overridable method. Should return [code]true[/code] if this playback is active and playing its audio stream.
2021-08-23 17:53:27 +00:00
</description>
</method>
<method name= "_mix" qualifiers= "virtual" >
2021-08-27 17:27:58 +00:00
<return type= "int" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "buffer" type= "AudioFrame*" />
<param index= "1" name= "rate_scale" type= "float" />
<param index= "2" name= "frames" type= "int" />
2021-08-23 17:53:27 +00:00
<description >
2024-01-07 16:28:48 +00:00
Override this method to customize how the audio stream is mixed. This method is called even if the playback is not active.
[b]Note:[/b] It is not useful to override this method in GDScript or C#. Only GDExtension can take advantage of it.
2021-08-23 17:53:27 +00:00
</description>
</method>
<method name= "_seek" qualifiers= "virtual" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "position" type= "float" />
2021-08-23 17:53:27 +00:00
<description >
2024-01-07 16:28:48 +00:00
Override this method to customize what happens when seeking this audio stream at the given [param position], such as by calling [method AudioStreamPlayer.seek].
2021-08-23 17:53:27 +00:00
</description>
</method>
2023-12-23 16:30:32 +00:00
<method name= "_set_parameter" qualifiers= "virtual" >
<return type= "void" />
<param index= "0" name= "name" type= "StringName" />
<param index= "1" name= "value" type= "Variant" />
<description >
Set the current value of a playback parameter by name (see [method AudioStream._get_parameter_list]).
</description>
</method>
2021-08-23 17:53:27 +00:00
<method name= "_start" qualifiers= "virtual" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "from_pos" type= "float" />
2021-08-23 17:53:27 +00:00
<description >
2024-01-07 16:28:48 +00:00
Override this method to customize what happens when the playback starts at the given position, such as by calling [method AudioStreamPlayer.play].
2021-08-23 17:53:27 +00:00
</description>
</method>
<method name= "_stop" qualifiers= "virtual" >
<return type= "void" />
<description >
2024-01-07 16:28:48 +00:00
Override this method to customize what happens when the playback is stopped, such as by calling [method AudioStreamPlayer.stop].
2021-08-23 17:53:27 +00:00
</description>
</method>
2022-07-20 23:00:58 +00:00
<method name= "_tag_used_streams" qualifiers= "virtual" >
<return type= "void" />
<description >
2024-01-07 16:28:48 +00:00
Overridable method. Called whenever the audio stream is mixed if the playback is active and [method AudioServer.set_enable_tagging_used_audio_streams] has been set to [code]true[/code]. Editor plugins may use this method to "tag" the current position along the audio stream and display it in a preview.
2022-07-20 23:00:58 +00:00
</description>
</method>
2024-04-18 14:50:34 +00:00
<method name= "get_sample_playback" qualifiers= "const" experimental= "" >
<return type= "AudioSamplePlayback" />
<description >
Returns the [AudioSamplePlayback] associated with this [AudioStreamPlayback] for playing back the audio sample of this stream.
</description>
</method>
<method name= "set_sample_playback" experimental= "" >
<return type= "void" />
<param index= "0" name= "playback_sample" type= "AudioSamplePlayback" />
<description >
Associates [AudioSamplePlayback] to this [AudioStreamPlayback] for playing back the audio sample of this stream.
</description>
</method>
2017-09-12 20:42:36 +00:00
</methods>
</class>