From e372d8434897ed6995da49873ef75782ace8459c Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 19 Jan 2017 21:23:22 +0000 Subject: [PATCH] espeak-ng: add a argument to --compile-phonemes. --- CHANGELOG.md | 2 ++ src/espeak-ng.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c94d36b..be05efff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ The espeak-ng project is a fork of the espeak project. * Documentation updates. * Emscripten support. * Merged the Android port into the main espeak-ng codebase. +* Extend `--compile-phoneme` to support specifying the source directory for + phoneme files. bug fixes: diff --git a/src/espeak-ng.c b/src/espeak-ng.c index d1304495..a657aff5 100644 --- a/src/espeak-ng.c +++ b/src/espeak-ng.c @@ -88,8 +88,8 @@ static const char *help_text = "\t Compile an MBROLA voice\n" "--compile-intonations\n" "\t Compile the intonation data\n" - "--compile-phonemes\n" - "\t Compile the phoneme data\n" + "--compile-phonemes=\n" + "\t Compile the phoneme data using or the default phsource directory\n" "--ipa Write phonemes to stdout using International Phonetic Alphabet\n" "--path=\"\"\n" "\t Specifies the directory containing the espeak-ng-data directory\n" @@ -319,7 +319,7 @@ int main(int argc, char **argv) { "tie", optional_argument, 0, 0x10d }, { "compile-mbrola", optional_argument, 0, 0x10e }, { "compile-intonations", no_argument, 0, 0x10f }, - { "compile-phonemes", no_argument, 0, 0x110 }, + { "compile-phonemes", optional_argument, 0, 0x110 }, { 0, 0, 0, 0 } }; @@ -543,7 +543,12 @@ int main(int argc, char **argv) { espeak_ng_InitializePath(data_path); espeak_ng_ERROR_CONTEXT context = NULL; - espeak_ng_STATUS result = espeak_ng_CompilePhonemeData(22050, stdout, &context); + espeak_ng_STATUS result; + if (optarg2) { + result = espeak_ng_CompilePhonemeDataPath(22050, optarg2, NULL, stdout, &context); + } else { + result = espeak_ng_CompilePhonemeData(22050, stdout, &context); + } if (result != ENS_OK) { espeak_ng_PrintStatusCodeMessage(result, stderr, context); espeak_ng_ClearErrorContext(&context);