From 2fcd3ee3e5dbf65841d5e457aa1a558fee471433 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 1 Apr 2020 19:25:16 +0200 Subject: Add audio support --- include/sound.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/sound.hpp b/include/sound.hpp index 2b07254..c512c31 100644 --- a/include/sound.hpp +++ b/include/sound.hpp @@ -3,7 +3,7 @@ typedef struct { void *handle; - char *buffer; + void *buffer; int buffer_size; unsigned int frames; } SoundDevice; @@ -14,14 +14,16 @@ typedef struct { to clean up internal resources. Returns 0 on success, or a negative value on failure. */ -int sound_device_get_by_name(SoundDevice *device, const char *name = "default", unsigned int num_channels = 1, unsigned int period_frame_size = 32); +int sound_device_get_by_name(SoundDevice *device, const char *name = "default", unsigned int num_channels = 2, unsigned int period_frame_size = 32); void sound_device_close(SoundDevice *device); /* Returns the next chunk of audio into @buffer. - Returns the size of the buffer, or a negative value on failure. + Returns the number of frames read, or a negative value on failure. */ -int sound_device_read_next_chunk(SoundDevice *device, char **buffer); +int sound_device_read_next_chunk(SoundDevice *device, void **buffer); + +int sound_device_get_buffer_size(SoundDevice *device); #endif /* GPU_SCREEN_RECORDER_H */ -- cgit v1.2.3