From 54b7c22f34e3a4174e0a896b4ad7f0cfbb54babd Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 05 Oct 2019 02:32:16 -0400 Subject: speech_init(): Hardcode register_cmu_us_slt() call And check for -lflite_cmu_us_slt. --- diff --git a/configure.ac b/configure.ac index 04be1b5..c568c5b 100644 --- a/configure.ac +++ b/configure.ac @@ -84,6 +84,7 @@ if test "x${address_sanitization}" = 'xyes'; then fi AC_CHECK_LIB([flite], [flite_init]) +AC_CHECK_LIB([flite_cmu_us_slt], [register_cmu_us_slt]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_HEADERS([config.h]) diff --git a/src/main.c b/src/main.c index 63bebc9..643b9f3 100644 --- a/src/main.c +++ b/src/main.c @@ -26,7 +26,7 @@ main(int argc, char **argv) { struct speech *speech; - speech = speech_init(argv[1]); + speech = speech_init(); speech_destroy(&speech); return 0; diff --git a/src/speech.c b/src/speech.c index 993c609..2ce3f12 100644 --- a/src/speech.c +++ b/src/speech.c @@ -27,24 +27,24 @@ #include +cst_voice *register_cmu_us_slt(const char *voxdir); + struct speech { cst_voice *voice; }; struct speech * -speech_init(const char *voice) +speech_init(void) { struct speech *speech; - assert(voice && *voice); - speech = calloc(1, sizeof(*speech)); if (speech == NULL) { return NULL; } flite_init(); - speech->voice = flite_voice_select(voice); + speech->voice = register_cmu_us_slt(NULL); if (speech->voice == NULL) { free(speech); return NULL; diff --git a/src/speech.h b/src/speech.h index 07a909d..96b7396 100644 --- a/src/speech.h +++ b/src/speech.h @@ -25,7 +25,7 @@ struct speech; struct speech * -speech_init(const char *voice); +speech_init(void); float speech_play_time(const struct speech *speech); -- cgit v0.9.1