mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
Allow out-of-tree intonations compilation
This commit is contained in:
@@ -191,6 +191,13 @@ ESPEAK_NG_API espeak_ng_STATUS
|
||||
espeak_ng_CompileIntonation(FILE *log,
|
||||
espeak_ng_ERROR_CONTEXT *context);
|
||||
|
||||
|
||||
ESPEAK_NG_API espeak_ng_STATUS
|
||||
espeak_ng_CompileIntonationPath(const char *source_path,
|
||||
const char *destination_path,
|
||||
FILE *log,
|
||||
espeak_ng_ERROR_CONTEXT *context);
|
||||
|
||||
/* eSpeak NG 1.49.1 */
|
||||
|
||||
ESPEAK_NG_API espeak_ng_STATUS
|
||||
|
||||
@@ -2697,8 +2697,20 @@ static int LookupEnvelopeName(const char *name)
|
||||
#pragma GCC visibility push(default)
|
||||
|
||||
espeak_ng_STATUS espeak_ng_CompileIntonation(FILE *log, espeak_ng_ERROR_CONTEXT *context)
|
||||
{
|
||||
return espeak_ng_CompileIntonationPath(NULL, NULL, log, context);
|
||||
}
|
||||
|
||||
espeak_ng_STATUS
|
||||
espeak_ng_CompileIntonationPath(const char *source_path,
|
||||
const char *destination_path,
|
||||
FILE *log,
|
||||
espeak_ng_ERROR_CONTEXT *context
|
||||
)
|
||||
{
|
||||
if (!log) log = stderr;
|
||||
if (!source_path) source_path = path_home;
|
||||
if (!destination_path) destination_path = path_home;
|
||||
|
||||
int ix;
|
||||
char *p;
|
||||
@@ -2722,9 +2734,9 @@ espeak_ng_STATUS espeak_ng_CompileIntonation(FILE *log, espeak_ng_ERROR_CONTEXT
|
||||
error_count = 0;
|
||||
f_errors = log;
|
||||
|
||||
sprintf(buf, "%s/../phsource/intonation.txt", path_home);
|
||||
sprintf(buf, "%s/../phsource/intonation.txt", source_path);
|
||||
if ((f_in = fopen(buf, "r")) == NULL) {
|
||||
sprintf(buf, "%s/../phsource/intonation", path_home);
|
||||
sprintf(buf, "%s/../phsource/intonation", source_path);
|
||||
if ((f_in = fopen(buf, "r")) == NULL) {
|
||||
int error = errno;
|
||||
fclose(f_errors);
|
||||
@@ -2777,7 +2789,7 @@ espeak_ng_STATUS espeak_ng_CompileIntonation(FILE *log, espeak_ng_ERROR_CONTEXT
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
sprintf(buf, "%s/intonations", path_home);
|
||||
sprintf(buf, "%s/intonations", destination_path);
|
||||
f_out = fopen(buf, "wb");
|
||||
if (f_out == NULL) {
|
||||
int error = errno;
|
||||
|
||||
Reference in New Issue
Block a user