summaryrefslogtreecommitdiff
path: root/doc/classes/AudioStreamGeneratorPlayback.xml
blob: 503f72a048c23db601f3b0cd3ef3b927b088dab7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioStreamGeneratorPlayback" inherits="AudioStreamPlaybackResampled" version="4.0">
	<brief_description>
		Plays back audio generated using [AudioStreamGenerator].
	</brief_description>
	<description>
		This class is meant to be used with [AudioStreamGenerator] to play back the generated audio in real-time.
	</description>
	<tutorials>
		<link title="Audio Generator Demo">https://godotengine.org/asset-library/asset/526</link>
		<link title="https://godotengine.org/article/godot-32-will-get-new-audio-features">Godot 3.2 will get new audio features</link>
	</tutorials>
	<methods>
		<method name="can_push_buffer" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="amount" type="int">
			</argument>
			<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.
			</description>
		</method>
		<method name="clear_buffer">
			<return type="void">
			</return>
			<description>
				Clears the audio sample data buffer.
			</description>
		</method>
		<method name="get_frames_available" qualifiers="const">
			<return type="int">
			</return>
			<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.
			</description>
		</method>
		<method name="get_skips" qualifiers="const">
			<return type="int">
			</return>
			<description>
			</description>
		</method>
		<method name="push_buffer">
			<return type="bool">
			</return>
			<argument index="0" name="frames" type="PackedVector2Array">
			</argument>
			<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.
			</description>
		</method>
		<method name="push_frame">
			<return type="bool">
			</return>
			<argument index="0" name="frame" type="Vector2">
			</argument>
			<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.
			</description>
		</method>
	</methods>
	<constants>
	</constants>
</class>