mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-12-03 14:59:52 +00:00
espeak_ng_CompilePhonemeDataPath: Allow the user to specify the source and destination paths for the phoneme data.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/* eSpeak NG API.
|
/* eSpeak NG API.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2016 Reece H. Dunn
|
* Copyright (C) 2015-2017 Reece H. Dunn
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -63,6 +63,8 @@ typedef enum {
|
|||||||
ENOUTPUT_MODE_SPEAK_AUDIO = 0x0002,
|
ENOUTPUT_MODE_SPEAK_AUDIO = 0x0002,
|
||||||
} espeak_ng_OUTPUT_MODE;
|
} espeak_ng_OUTPUT_MODE;
|
||||||
|
|
||||||
|
/* eSpeak NG 1.49.0 */
|
||||||
|
|
||||||
typedef struct espeak_ng_ERROR_CONTEXT_ *espeak_ng_ERROR_CONTEXT;
|
typedef struct espeak_ng_ERROR_CONTEXT_ *espeak_ng_ERROR_CONTEXT;
|
||||||
|
|
||||||
ESPEAK_NG_API void
|
ESPEAK_NG_API void
|
||||||
@@ -161,6 +163,15 @@ ESPEAK_NG_API espeak_ng_STATUS
|
|||||||
espeak_ng_CompileIntonation(FILE *log,
|
espeak_ng_CompileIntonation(FILE *log,
|
||||||
espeak_ng_ERROR_CONTEXT *context);
|
espeak_ng_ERROR_CONTEXT *context);
|
||||||
|
|
||||||
|
/* eSpeak NG 1.49.1 */
|
||||||
|
|
||||||
|
ESPEAK_NG_API espeak_ng_STATUS
|
||||||
|
espeak_ng_CompilePhonemeDataPath(long rate,
|
||||||
|
const char *source_path,
|
||||||
|
const char *destination_path,
|
||||||
|
FILE *log,
|
||||||
|
espeak_ng_ERROR_CONTEXT *context);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2640,7 +2640,20 @@ static void CompilePhonemeFiles()
|
|||||||
|
|
||||||
#pragma GCC visibility push(default)
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
espeak_ng_STATUS espeak_ng_CompilePhonemeData(long rate, FILE *log, espeak_ng_ERROR_CONTEXT *context)
|
espeak_ng_STATUS
|
||||||
|
espeak_ng_CompilePhonemeData(long rate,
|
||||||
|
FILE *log,
|
||||||
|
espeak_ng_ERROR_CONTEXT *context)
|
||||||
|
{
|
||||||
|
return espeak_ng_CompilePhonemeDataPath(rate, NULL, NULL, log, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
espeak_ng_STATUS
|
||||||
|
espeak_ng_CompilePhonemeDataPath(long rate,
|
||||||
|
const char *source_path,
|
||||||
|
const char *destination_path,
|
||||||
|
FILE *log,
|
||||||
|
espeak_ng_ERROR_CONTEXT *context)
|
||||||
{
|
{
|
||||||
if (!log) log = stderr;
|
if (!log) log = stderr;
|
||||||
|
|
||||||
@@ -2648,8 +2661,17 @@ espeak_ng_STATUS espeak_ng_CompilePhonemeData(long rate, FILE *log, espeak_ng_ER
|
|||||||
char phsrc[sizeof(path_home)+40]; // Source: path to the 'phonemes' source file.
|
char phsrc[sizeof(path_home)+40]; // Source: path to the 'phonemes' source file.
|
||||||
char phdst[sizeof(path_home)+40]; // Destination: path to the phondata/phontab/phonindex output files.
|
char phdst[sizeof(path_home)+40]; // Destination: path to the phondata/phontab/phonindex output files.
|
||||||
|
|
||||||
sprintf(phsrc, "%s/../phsource", path_home);
|
if (source_path) {
|
||||||
sprintf(phdst, "%s", path_home);
|
sprintf(phsrc, "%s", source_path);
|
||||||
|
} else {
|
||||||
|
sprintf(phsrc, "%s/../phsource", path_home);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (destination_path) {
|
||||||
|
sprintf(phdst, "%s", destination_path);
|
||||||
|
} else {
|
||||||
|
sprintf(phdst, "%s", path_home);
|
||||||
|
}
|
||||||
|
|
||||||
samplerate_native = samplerate = rate;
|
samplerate_native = samplerate = rate;
|
||||||
LoadPhData(NULL, NULL);
|
LoadPhData(NULL, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user