godot/doc/classes/AudioStreamGeneratorPlayback.xml

54 lines
2.5 KiB
XML
Raw Normal View History

2019-04-15 20:49:41 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioStreamGeneratorPlayback" inherits="AudioStreamPlaybackResampled" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
2019-04-15 20:49:41 +08:00
<brief_description>
Plays back audio generated using [AudioStreamGenerator].
2019-04-15 20:49:41 +08:00
</brief_description>
<description>
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>
<link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
<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">
<return type="bool" />
<argument index="0" name="amount" type="int" />
2019-04-15 20:49:41 +08:00
<description>
Returns [code]true[/code] if a buffer of the size [code]amount[/code] 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">
<return type="void" />
2019-04-15 20:49:41 +08:00
<description>
Clears the audio sample data buffer.
2019-04-15 20:49:41 +08:00
</description>
</method>
<method name="get_frames_available" qualifiers="const">
<return type="int" />
2019-04-15 20:49:41 +08:00
<description>
Returns the number of audio data frames left to play. If this returned number reaches [code]0[/code], the audio will stop playing until frames are added again. Therefore, make sure your script can always generate and push new audio frames fast enough to avoid audio cracking.
2019-04-15 20:49:41 +08:00
</description>
</method>
<method name="get_skips" qualifiers="const">
<return type="int" />
2019-04-15 20:49:41 +08:00
<description>
</description>
</method>
<method name="push_buffer">
<return type="bool" />
<argument index="0" name="frames" type="PackedVector2Array" />
2019-04-15 20:49:41 +08:00
<description>
Pushes several audio data frames to the buffer. This is usually more efficient than [method push_frame] in C# and compiled languages via GDNative, 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">
<return type="bool" />
<argument index="0" name="frame" type="Vector2" />
2019-04-15 20:49:41 +08:00
<description>
Pushes a single audio data frame to the buffer. This is usually less efficient than [method push_buffer] in C# and compiled languages via GDNative, but [method push_frame] may be [i]more[/i] efficient in GDScript.
2019-04-15 20:49:41 +08:00
</description>
</method>
</methods>
</class>