diff --git a/src/espeakedit.cpp b/src/espeakedit.cpp index feb7b749..b7c0c900 100644 --- a/src/espeakedit.cpp +++ b/src/espeakedit.cpp @@ -41,9 +41,6 @@ static const char *about_string = "espeakedit %s
Author: "http://espeak.sourceforge.net
" "Licensed under GNU General Public License version 3
"; -extern "C" void CompilePhonemeData(long rate, FILE *log); -extern "C" espeak_ng_STATUS CompileIntonation(FILE *log); - int progress_max; int gui_flag = 0; @@ -121,8 +118,8 @@ else fprintf(stderr, "Failed to load default voice\n"); exit(1); } - CompilePhonemeData(22050, stderr); - CompileIntonation(stderr); + espeak_ng_CompilePhonemeData(22050, stderr); + espeak_ng_CompileIntonation(stderr); } exit(0); } diff --git a/src/include/espeak-ng/espeak_ng.h b/src/include/espeak-ng/espeak_ng.h index 9b54eaa4..dd74f5ec 100644 --- a/src/include/espeak-ng/espeak_ng.h +++ b/src/include/espeak-ng/espeak_ng.h @@ -48,6 +48,12 @@ typedef enum { ESPEAK_NG_API espeak_ng_STATUS espeak_ng_CompileMbrolaVoice(const char *path, FILE *log); +ESPEAK_NG_API espeak_ng_STATUS +espeak_ng_CompilePhonemeData(long rate, FILE *log); + +ESPEAK_NG_API espeak_ng_STATUS +espeak_ng_CompileIntonation(FILE *log); + #ifdef __cplusplus } #endif diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 7785b681..dcf3f9ad 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -3392,7 +3392,7 @@ static void CompilePhonemeFiles() -static void CompilePhonemeData2(const char *source, FILE *log) +static espeak_ng_STATUS CompilePhonemeData2(const char *source, FILE *log) {//================================================ char fname[sizeof(path_home)+40]; sprintf(fname,"%s/../phsource",path_home); @@ -3412,7 +3412,7 @@ make_envs(); if(!access(fname, 755)) { fprintf(log,"Can't find phoneme source directory: %s\n",fname); - return; + return ENE_READ_ERROR; } strncpy0(current_fname,source,sizeof(current_fname)); @@ -3422,7 +3422,7 @@ make_envs(); if(f_in == NULL) { fprintf(log,"Can't read master phonemes file: %s\n",fname); - return; + return ENE_READ_ERROR; } sprintf(fname,"%s/../phsource/%s",path_home,"error_log"); @@ -3468,7 +3468,7 @@ make_envs(); if(f_phdata==NULL || f_phindex==NULL || f_phtab==NULL) { - return; + return ENE_WRITE_ERROR; } sprintf(fname,"%s/../phsource/compile_prog_log",path_home); @@ -3521,6 +3521,7 @@ fprintf(f_errors,"\nRefs %d, Reused %d\n",count_references,duplicate_references fclose(f_errors); ReadPhondataManifest(); + return ENS_OK; } // end of CompilePhonemeData @@ -3569,7 +3570,9 @@ int LookupEnvelopeName(const char *name) } -espeak_ng_STATUS CompileIntonation(FILE *log) +#pragma GCC visibility push(default) + +espeak_ng_STATUS espeak_ng_CompileIntonation(FILE *log) {//===================== int ix; char *p; @@ -3870,9 +3873,11 @@ espeak_ng_STATUS CompileIntonation(FILE *log) -void CompilePhonemeData(long rate, FILE *log) +espeak_ng_STATUS espeak_ng_CompilePhonemeData(long rate, FILE *log) { WavegenInit(rate, 0); WavegenSetVoice(voice); - CompilePhonemeData2("phonemes", log); + return CompilePhonemeData2("phonemes", log); } + +#pragma GCC visibility pop