2019-04-15 20:49:41 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 16:08:05 +08:00
<class name= "AudioStreamGeneratorPlayback" inherits= "AudioStreamPlaybackResampled" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2019-04-15 20:49:41 +08:00
<brief_description >
2021-05-13 08:30:34 +08:00
Plays back audio generated using [AudioStreamGenerator].
2019-04-15 20:49:41 +08:00
</brief_description>
<description >
2021-05-13 08:30:34 +08:00
This class is meant to be used with [AudioStreamGenerator] to play back the generated audio in real-time.
2019-04-15 20:49:41 +08:00
</description>
<tutorials >
2021-05-13 08:30:34 +08:00
<link title= "Audio Generator Demo" > https://godotengine.org/asset-library/asset/526</link>
2022-01-30 09:33:16 +08:00
<link title= "Godot 3.2 will get new audio features" > https://godotengine.org/article/godot-32-will-get-new-audio-features</link>
2019-04-15 20:49:41 +08:00
</tutorials>
<methods >
<method name= "can_push_buffer" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "bool" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "amount" type= "int" />
2019-04-15 20:49:41 +08:00
<description >
2022-08-13 01:51:01 +08:00
Returns [code]true[/code] if a buffer of the size [param amount] can be pushed to the audio sample data buffer without overflowing it, [code]false[/code] otherwise.
2019-04-15 20:49:41 +08:00
</description>
</method>
<method name= "clear_buffer" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2019-04-15 20:49:41 +08:00
<description >
2021-05-13 08:30:34 +08:00
Clears the audio sample data buffer.
2019-04-15 20:49:41 +08:00
</description>
</method>
<method name= "get_frames_available" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2019-04-15 20:49:41 +08:00
<description >
2022-09-10 19:39:13 +08:00
Returns the number of frames that can be pushed to the audio sample data buffer without overflowing it. If the result is [code]0[/code], the buffer is full.
2019-04-15 20:49:41 +08:00
</description>
</method>
<method name= "get_skips" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2019-04-15 20:49:41 +08:00
<description >
2023-10-16 18:59:14 +08:00
Returns the number of times the playback skipped due to a buffer underrun in the audio sample data. This value is reset at the start of the playback.
2019-04-15 20:49:41 +08:00
</description>
</method>
<method name= "push_buffer" >
2021-07-30 21:28:05 +08:00
<return type= "bool" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "frames" type= "PackedVector2Array" />
2019-04-15 20:49:41 +08:00
<description >
2022-03-09 20:56:14 +08:00
Pushes several audio data frames to the buffer. This is usually more efficient than [method push_frame] in C# and compiled languages via GDExtension, but [method push_buffer] may be [i]less[/i] efficient in GDScript.
2019-04-15 20:49:41 +08:00
</description>
</method>
<method name= "push_frame" >
2021-07-30 21:28:05 +08:00
<return type= "bool" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "frame" type= "Vector2" />
2019-04-15 20:49:41 +08:00
<description >
2022-03-09 20:56:14 +08:00
Pushes a single audio data frame to the buffer. This is usually less efficient than [method push_buffer] in C# and compiled languages via GDExtension, but [method push_frame] may be [i]more[/i] efficient in GDScript.
2019-04-15 20:49:41 +08:00
</description>
</method>
</methods>
</class>