summaryrefslogtreecommitdiffstats
path: root/src/vox.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vox.c')
-rw-r--r--src/vox.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/vox.c b/src/vox.c
index 775aee9..421ac00 100644
--- a/src/vox.c
+++ b/src/vox.c
@@ -277,6 +277,14 @@ static int vox_generate(xas_vox *vox, ...) {
return xas_vox_generate(vox);
}
+static xas_object_call_table call_table = {
+ .start = (xas_object_start_callback)vox_generate,
+ .stop = (xas_object_stop_callback)vox_stop,
+ .set_gain = (xas_object_set_gain_callback)set_gain,
+ .stream_new = (xas_object_stream_new_callback)xas_vox_stream_new,
+ .destroy = (xas_object_destroy_callback)xas_vox_destroy
+};
+
xas_vox *xas_vox_new_args(xas_audio_format format,
size_t buffer_size,
const char *text2wave_path,
@@ -288,11 +296,7 @@ xas_vox *xas_vox_new_args(xas_audio_format format,
goto error_malloc_vox;
}
- vox->obj.start = (xas_object_start_callback)vox_generate;
- vox->obj.stop = (xas_object_stop_callback)vox_stop;
- vox->obj.set_gain = (xas_object_set_gain_callback)set_gain;
- vox->obj.stream_new = (xas_object_stream_new_callback)xas_vox_stream_new;
- vox->obj.destroy = (xas_object_destroy_callback)xas_vox_destroy;
+ vox->obj.table = &call_table;
vox->text2wave_path = text2wave_path;