- github_url
hide
Inherits: AudioStreamPlaybackResampled<class_AudioStreamPlaybackResampled>
< AudioStreamPlayback<class_AudioStreamPlayback>
< RefCounted<class_RefCounted>
< Object<class_Object>
Plays back audio generated using AudioStreamGenerator<class_AudioStreamGenerator>
.
classref-introduction-group
This class is meant to be used with AudioStreamGenerator<class_AudioStreamGenerator>
to play back the generated audio in real-time.
classref-introduction-group
classref-reftable-group
bool<class_bool> |
can_push_buffer<class_AudioStreamGeneratorPlayback_method_can_push_buffer> (amount: int<class_int> ) const (This method has no side effects. It doesn't modify any of the instance's member variables.) |
void (No return value.) |
:ref:clear_buffer<class_AudioStreamGeneratorPlayback_method_clear_buffer>() |
int<class_int> |
get_frames_available<class_AudioStreamGeneratorPlayback_method_get_frames_available> () const (This method has no side effects. It doesn't modify any of the instance's member variables.) |
int<class_int> |
get_skips<class_AudioStreamGeneratorPlayback_method_get_skips> () const (This method has no side effects. It doesn't modify any of the instance's member variables.) |
bool<class_bool> |
push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer> (frames: PackedVector2Array<class_PackedVector2Array> ) |
bool<class_bool> |
push_frame<class_AudioStreamGeneratorPlayback_method_push_frame> (frame: Vector2<class_Vector2> ) |
classref-section-separator
classref-descriptions-group
classref-method
bool<class_bool>
can_push_buffer(amount: int<class_int>
) const (This method has no side effects. It doesn't modify any of the instance's member variables.)
Returns true
if a buffer of the size amount
can be pushed to the audio sample data buffer without overflowing it, false
otherwise.
classref-item-separator
classref-method
void (No return value.)
clear_buffer()
Clears the audio sample data buffer.
classref-item-separator
classref-method
int<class_int>
get_frames_available() const (This method has no side effects. It doesn't modify any of the instance's member variables.)
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.
classref-item-separator
classref-method
int<class_int>
get_skips() const (This method has no side effects. It doesn't modify any of the instance's member variables.)
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.
classref-item-separator
classref-method
bool<class_bool>
push_buffer(frames: PackedVector2Array<class_PackedVector2Array>
)
Pushes several audio data frames to the buffer. This is usually more efficient than push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>
in C# and compiled languages via GDExtension, but push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>
may be less efficient in GDScript.
classref-item-separator
classref-method
bool<class_bool>
push_frame(frame: Vector2<class_Vector2>
)
Pushes a single audio data frame to the buffer. This is usually less efficient than push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>
in C# and compiled languages via GDExtension, but push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>
may be more efficient in GDScript.