Class AudioStreamGeneratorPlayback
Plays back audio generated using AudioStreamGenerator.
- Inheritance
-
AudioStreamGeneratorPlayback
Remarks
This class is meant to be used with AudioStreamGenerator to play back the generated audio in real-time.
See Also
Methods
can_push_buffer(int)
Qualifiers: const
Returns true
if a buffer of the size amount
can be pushed to the audio sample data buffer without overflowing it, false
otherwise.
bool can_push_buffer(int amount)
Parameters
amount
int
clear_buffer
Clears the audio sample data buffer.
void clear_buffer
get_frames_available
Qualifiers: const
Returns the number of frames that can be pushed to the audio sample data buffer without overflowing it. If the result is 0
, the buffer is full.
int get_frames_available
get_skips
Qualifiers: const
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.
int get_skips
push_buffer(PackedVector2Array)
Pushes several audio data frames to the buffer. This is usually more efficient than AudioStreamGeneratorPlayback.push_frame in C# and compiled languages via GDExtension, but AudioStreamGeneratorPlayback.push_buffer may be less efficient in GDScript.
bool push_buffer(PackedVector2Array frames)
Parameters
frames
PackedVector2Array
push_frame(Vector2)
Pushes a single audio data frame to the buffer. This is usually less efficient than AudioStreamGeneratorPlayback.push_buffer in C# and compiled languages via GDExtension, but AudioStreamGeneratorPlayback.push_frame may be more efficient in GDScript.
bool push_frame(Vector2 frame)
Parameters
frame
Vector2