diff --git a/src/espeak-ng.c b/src/espeak-ng.c index cf70192e..345fee84 100644 --- a/src/espeak-ng.c +++ b/src/espeak-ng.c @@ -30,6 +30,7 @@ #include #include "speak_lib.h" +#include "espeak_ng.h" #ifndef S_ISDIR #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) @@ -73,6 +74,8 @@ static const char *help_text = "--compile=\n" "\t Compile pronunciation rules and dictionary from the current\n" "\t directory. specifies the language\n" +"--compile-mbrola=\n" +"\t Compile an MBROLA voice\n" "--ipa Write phonemes to stdout using International Phonetic Alphabet\n" "--path=\"\"\n" "\t Specifies the directory containing the espeak-data directory\n" @@ -425,6 +428,7 @@ int main (int argc, char **argv) {"version", no_argument, 0, 0x10b}, {"sep", optional_argument, 0, 0x10c}, {"tie", optional_argument, 0, 0x10d}, + {"compile-mbrola", optional_argument, 0, 0x10e}, {0, 0, 0, 0} }; @@ -710,6 +714,10 @@ int main (int argc, char **argv) phonemes_separator = 0x200d; // ZWJ break; + case 0x10e: // --compile-mbrola + samplerate = espeak_Initialize(AUDIO_OUTPUT_PLAYBACK,0,data_path,0); + espeak_ng_CompileMbrolaVoice(optarg2, stdout); + exit(0); default: exit(0); diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 3baf8c13..824f2089 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -19,7 +19,6 @@ ***************************************************************************/ #include -#include #include "speak_lib.h" #include "espeak_ng.h" @@ -28,6 +27,14 @@ #include "speech.h" #include "synthesize.h" +static const char *basename(const char *filename) +{ + const char *current = filename + strlen(filename); + while (current != filename && !(*current == '/' || *current == '\\')) + --current; + return current == filename ? current : current + 1; +} + static unsigned int StringToWord(const char *string) { // Pack 4 characters into a word @@ -48,6 +55,7 @@ static unsigned int StringToWord(const char *string) return(word); } +#pragma GCC visibility push(default) espeak_ng_STATUS espeak_ng_CompileMbrolaVoice(const char *filepath, FILE *log) { char *p; @@ -133,3 +141,4 @@ espeak_ng_STATUS espeak_ng_CompileMbrolaVoice(const char *filepath, FILE *log) fprintf(log, "Mbrola translation file: %s -- %d phonemes\n", buf, count); return ENS_OK; } +#pragma GCC visibility pop