Time based audio latency, test, might fix some shits

This commit is contained in:
dec05eba
2024-04-11 14:40:27 +02:00
parent f8322c3c28
commit 52688dad72
3 changed files with 85 additions and 163 deletions

View File

@@ -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<AudioInput> get_pulseaudio_inputs();