0.2.0-dev Download ZIP
54 lines ·2.5 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="AudioStreamGeneratorPlayback" inherits="AudioStreamPlaybackResampled" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Plays back audio generated using [AudioStreamGenerator]. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | This class is meant to be used with [AudioStreamGenerator] to play back the generated audio in real-time. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | <link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/2759</link> |
| 11 | <link title="Godot 3.2 will get new audio features">https://godotengine.org/article/godot-32-will-get-new-audio-features</link> |
| 12 | </tutorials> |
| 13 | <methods> |
| 14 | <method name="can_push_buffer" qualifiers="const"> |
| 15 | <return type="bool" /> |
| 16 | <param index="0" name="amount" type="int" /> |
| 17 | <description> |
| 18 | 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. |
| 19 | </description> |
| 20 | </method> |
| 21 | <method name="clear_buffer"> |
| 22 | <return type="void" /> |
| 23 | <description> |
| 24 | Clears the audio sample data buffer. |
| 25 | </description> |
| 26 | </method> |
| 27 | <method name="get_frames_available" qualifiers="const"> |
| 28 | <return type="int" /> |
| 29 | <description> |
| 30 | 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. |
| 31 | </description> |
| 32 | </method> |
| 33 | <method name="get_skips" qualifiers="const"> |
| 34 | <return type="int" /> |
| 35 | <description> |
| 36 | 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. |
| 37 | </description> |
| 38 | </method> |
| 39 | <method name="push_buffer"> |
| 40 | <return type="bool" /> |
| 41 | <param index="0" name="frames" type="PackedVector2Array" /> |
| 42 | <description> |
| 43 | 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. |
| 44 | </description> |
| 45 | </method> |
| 46 | <method name="push_frame"> |
| 47 | <return type="bool" /> |
| 48 | <param index="0" name="frame" type="Vector2" /> |
| 49 | <description> |
| 50 | 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. |
| 51 | </description> |
| 52 | </method> |
| 53 | </methods> |
| 54 | </class> |