From 52688dad72542b7f3f7bce7a8ff0d7fd7827c5ea Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 11 Apr 2024 14:40:27 +0200 Subject: Time based audio latency, test, might fix some shits --- include/sound.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sound.hpp b/include/sound.hpp index 6873e90..32821bc 100644 --- a/include/sound.hpp +++ b/include/sound.hpp @@ -24,6 +24,7 @@ typedef struct { void *handle; unsigned int frames; + double latency_seconds; } SoundDevice; struct AudioInput { @@ -53,9 +54,9 @@ void sound_device_close(SoundDevice *device); /* Returns the next chunk of audio into @buffer. - Returns the number of frames read, or a negative value on failure. + Returns the number of bytes read, or a negative value on failure. */ -int sound_device_read_next_chunk(SoundDevice *device, void **buffer); +int sound_device_read_next_chunk(SoundDevice *device, void **buffer, double timeout_sec); std::vector get_pulseaudio_inputs(); -- cgit v1.2.3