From 009b6b5d14193b7474c7d702afe4bcc752d7d93e Mon Sep 17 00:00:00 2001 From: golubovsky Date: Sat, 23 Feb 2019 22:51:32 -0500 Subject: [PATCH] Finished the voice load code. Dumping voice def does not seem possible because it is not stored in a single place. Signed-off-by: golubovsky --- src/espeak-ng.c | 9 +-------- src/include/espeak-ng/espeak_ng.h | 3 +++ src/libespeak-ng/voices.c | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/espeak-ng.c b/src/espeak-ng.c index 0d5a09fe..10b8a887 100644 --- a/src/espeak-ng.c +++ b/src/espeak-ng.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -114,9 +115,6 @@ static const char *help_text = "\t List the available voices for the specified language.\n" "\t If is omitted, then list all voices.\n" "--load Load voice from a file in current directory by name.\n" - "--dump=\n" - "\t Dump the currently loaded voice definition into a file\n" - "\t in the current directory\n" "-h, --help Show this help.\n"; int samplerate; @@ -326,7 +324,6 @@ int main(int argc, char **argv) { "compile-intonations", no_argument, 0, 0x10f }, { "compile-phonemes", optional_argument, 0, 0x110 }, { "load", no_argument, 0, 0x111 }, - { "dump", required_argument, 0, 0x112 }, { 0, 0, 0, 0 } }; @@ -358,7 +355,6 @@ int main(int argc, char **argv) int option_waveout = 0; espeak_VOICE voice_select; - char dumpfile[200]; char filename[200]; char voicename[40]; char devicename[200]; @@ -573,9 +569,6 @@ int main(int argc, char **argv) case 0x111: // --load flag_load = 1; break; - case 0x112: // --dump - strncpy(dumpfile, optarg2, sizeof(dumpfile) - 1); - break; default: exit(0); } diff --git a/src/include/espeak-ng/espeak_ng.h b/src/include/espeak-ng/espeak_ng.h index 36d2682b..b9804fce 100644 --- a/src/include/espeak-ng/espeak_ng.h +++ b/src/include/espeak-ng/espeak_ng.h @@ -119,6 +119,9 @@ espeak_ng_SetPunctuationList(const wchar_t *punctlist); ESPEAK_NG_API espeak_ng_STATUS espeak_ng_SetVoiceByName(const char *name); +ESPEAK_NG_API espeak_ng_STATUS +espeak_ng_SetVoiceByFile(const char *filename); + ESPEAK_NG_API espeak_ng_STATUS espeak_ng_SetVoiceByProperties(espeak_VOICE *voice_selector); diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index 66b30f8f..3eca48f7 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -1466,6 +1466,7 @@ static void GetVoices(const char *path, int len_path_voices, int is_language_fil #pragma GCC visibility push(default) + ESPEAK_NG_API espeak_ng_STATUS espeak_ng_SetVoiceByFile(const char *filename) { espeak_VOICE *v;