diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-04-01 19:25:16 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-06-21 14:41:11 +0200 |
commit | 2fcd3ee3e5dbf65841d5e457aa1a558fee471433 (patch) | |
tree | 3858678f2954b91f092ecbfe6b60c0a5f941585b /include/sound.hpp | |
parent | 5e60805c3681a705240d49a0c5c589ff65d7aa83 (diff) |
Add audio support
Diffstat (limited to 'include/sound.hpp')
-rw-r--r-- | include/sound.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
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 */ |