aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-03-29 09:10:24 +0200
committerdec05eba <dec05eba@protonmail.com>2020-03-29 09:10:24 +0200
commit7c8c97b1a8f844d7e0e682abe0dcba01c2973a66 (patch)
tree8f7a34dad700a44a866475fd0a7e24ffe829dbf9 /include
parentbcb79582c511706358e85d95c003e4feb85c66df (diff)
add alsa
Diffstat (limited to 'include')
-rw-r--r--include/sound.hpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/sound.hpp b/include/sound.hpp
new file mode 100644
index 0000000..41dd043
--- /dev/null
+++ b/include/sound.hpp
@@ -0,0 +1,27 @@
+#ifndef GPU_SCREEN_RECORDER_H
+#define GPU_SCREEN_RECORDER_H
+
+typedef struct {
+ void *handle;
+ char *buffer;
+ int buffer_size;
+ unsigned int frames;
+} SoundDevice;
+
+/*
+ Get a sound device by name, returning the device into the @device parameter.
+ The device should be closed with @sound_device_close after it has been used
+ 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_close(SoundDevice *device);
+
+/*
+ Returns the next chunk of audio into @buffer.
+ Returns the size of the buffer, or a negative value on failure.
+*/
+int sound_device_read_next_chunk(SoundDevice *device, char **buffer);
+
+#endif /* GPU_SCREEN_RECORDER_H */