aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2026-07-03 23:48:34 +0200
committerdec05eba <dec05eba@protonmail.com>2026-07-03 23:48:34 +0200
commit8be5f0a256dbd002ec30d9ce95fb4ceda2451a5a (patch)
tree1421326c4344d149cce9ac6833977221b2e12a5f /include
parentf7564b269dfb082db9eeee933a91d9901ac9f8a3 (diff)
Fix audio sometimes glitching at the start of video
Diffstat (limited to 'include')
-rw-r--r--include/sound.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/sound.hpp b/include/sound.hpp
index c7164f8..6d903d8 100644
--- a/include/sound.hpp
+++ b/include/sound.hpp
@@ -71,6 +71,13 @@ int sound_device_get_by_name(SoundDevice *device, const char *node_name, const c
void sound_device_close(SoundDevice *device);
/*
+ Discards the audio that has been captured so far.
+ Call this before the first call to sound_device_read_next_chunk to not get audio that was captured before that point,
+ since the sound device can be created a while before audio capture starts.
+*/
+void sound_device_flush(SoundDevice *device);
+
+/*
Returns the next chunk of audio into @buffer.
Returns the number of frames read, or a negative value on failure.
*/