godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.3k stars 21.24k forks source link

Add `AudioStreamGeneratorPlayback::get_frames_buffered()` and `AudioStreamGeneratorPlayback::get_frames_buffer_length()` methods #99512

Open Brawmario opened 15 hours ago

Brawmario commented 15 hours ago

Implement AudioStreamGeneratorPlayback::get_frames_buffered() and AudioStreamGeneratorPlayback::get_frames_buffer_length() methods in order to streamline using AudioStreamGenerator as a queue for procedurally/externally generated audio frames.

Implements godotengine/godot-proposals#11180.

I would like to point out that AudioEffectCapture has equivalent methods to the ones added in this PR (AudioEffectCapture::get_frames_available() and AudioEffectCapture::get_buffer_length_frames()).