From f45b143dcf90970122436d10bd6226f577a9310d Mon Sep 17 00:00:00 2001 From: kartofen Date: Sat, 22 Oct 2022 23:53:29 +0300 Subject: works with alsa and runs at 30 fps --- src/audio.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/audio.h') diff --git a/src/audio.h b/src/audio.h index 2ca554d..0b6fbab 100644 --- a/src/audio.h +++ b/src/audio.h @@ -1,8 +1,22 @@ #ifndef AUDIO_H #define AUDIO_H -int audio_play(char *buf); +typedef struct audio_handle { + void *h; + unsigned long frames; +} audio_handle; -int audio_record(char *buf); +typedef enum audio_handle_types { + RECORD, + PLAYBACK +} audio_handle_types; + +int audio_create(audio_handle *handle, audio_handle_types t); + +int audio_play(audio_handle *handle, char *buf); + +int audio_record(audio_handle *handle, char *buf); + +void audio_destroy(audio_handle *handle); #endif -- cgit v1.2.3