#ifndef _XAS_SYNTH_H #define _XAS_SYNTH_H #include #include #include typedef struct _xas_synth xas_synth; 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(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 */