From 7b8375ee2026d42b5444f8ae0e7b98e272e87d69 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 13 Mar 2022 17:16:26 -0400 Subject: Refactor drone speech modules Changes: * Implement xas_drone_vox type to wrap a xas_vox and audio stream object in one, and save rendered speech to a drone's audio bank * Implement xas_drone_speech_import() as a convenience wrapper to xas_drone_vox methods --- examples/seq.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/seq.c b/examples/seq.c index 601e46a..ab8da55 100644 --- a/examples/seq.c +++ b/examples/seq.c @@ -195,19 +195,15 @@ int main(int argc, char **argv) { if ((drone = xas_drone_new(scene, (xas_spatial_coord){ 0.0, 0.0, -1.0 }, - 1.3f, 2646000, - 4, - drone_lines)) == NULL) { + 4)) == NULL) { goto error_drone_new; } if ((nurse = xas_drone_new(scene, (xas_spatial_coord){ 1.0, 0.0, 0.0 }, - 1.0f, 2646000, - 4, - nurse_lines)) == NULL) { + 4)) == NULL) { goto error_drone_new_nurse; } @@ -217,6 +213,14 @@ int main(int argc, char **argv) { goto error_drone_chamber_new; } + if (xas_drone_speech_import(drone, NULL, 0.75f, 0, 4, drone_lines) < 0) { + goto error_drone_speech_import; + } + + if (xas_drone_speech_import(nurse, NULL, 1.0f, 0, 4, nurse_lines) < 0) { + goto error_drone_speech_import_nurse; + } + xas_drone_chamber_insert_drone(chamber, drone, 0); xas_drone_chamber_insert_drone(chamber, nurse, 1); xas_drone_chamber_bass_start(chamber); @@ -291,6 +295,8 @@ int main(int argc, char **argv) { return EX_OK; error_seq: +error_drone_speech_import_nurse: +error_drone_speech_import: xas_drone_chamber_destroy(chamber); error_drone_chamber_new: -- cgit v1.2.3