summaryrefslogtreecommitdiffstats
path: root/include/xas
diff options
context:
space:
mode:
Diffstat (limited to 'include/xas')
-rw-r--r--include/xas/synth.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/xas/synth.h b/include/xas/synth.h
index 4d0fbd0..014d330 100644
--- a/include/xas/synth.h
+++ b/include/xas/synth.h
@@ -2,6 +2,9 @@
#define _XAS_SYNTH_H
#include <stdint.h>
+#include <sys/types.h>
+
+#include <xas/audio.h>
typedef struct _xas_synth xas_synth;
@@ -10,15 +13,24 @@ typedef int16_t (*xas_synth_callback_sample)(xas_synth *synth, void *ctx);
typedef void (*xas_synth_callback_destroy)(xas_synth *synth, void *ctx);
struct _xas_synth {
+ size_t sample_rate;
+
xas_synth_callback_sample sample;
xas_synth_callback_destroy destroy;
void *ctx;
};
-xas_synth *xas_synth_new(xas_synth_callback_sample sample,
+xas_synth *xas_synth_new(size_t sample_rate,
+ xas_synth_callback_sample sample,
xas_synth_callback_destroy destroy,
void *ctx);
void xas_synth_destroy(xas_synth *synth);
+int16_t xas_synth_sample(xas_synth *synth);
+
+ssize_t xas_synth_fill(xas_synth *synth,
+ int16_t *samples,
+ size_t count);
+
#endif /* _XAS_SYNTH_H */