This commit is contained in:
Valdis Vitolins
2016-09-10 13:21:21 +03:00
230 changed files with 828 additions and 765 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ ESPEAK_NG_API void espeak_ng_GetStatusCodeMessage(espeak_ng_STATUS status, char
strncpy0(buffer, "Compile error", length);
break;
case ENS_VERSION_MISMATCH:
strncpy0(buffer, "Wrong version of espeak-data", length);
strncpy0(buffer, "Wrong version of espeak-ng-data", length);
break;
case ENS_FIFO_BUFFER_FULL:
strncpy0(buffer, "The FIFO buffer is full", length);
+1 -1
View File
@@ -800,7 +800,7 @@ static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ER
return EINVAL;
if (fname[0] != '/') {
// a relative path, look in espeak-data/soundicons
// a relative path, look in espeak-ng-data/soundicons
sprintf(fname2, "%s%csoundicons%c%s", path_home, PATHSEP, PATHSEP, fname);
fname = fname2;
}
+8 -12
View File
@@ -56,10 +56,6 @@
#include "fifo.h"
#include "event.h"
#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
unsigned char *outbuf = NULL;
espeak_EVENT *event_list = NULL;
@@ -82,7 +78,7 @@ t_espeak_callback *synth_callback = NULL;
int (*uri_callback)(int, const char *, const char *) = NULL;
int (*phoneme_callback)(const char *) = NULL;
char path_home[N_PATH_HOME]; // this is the espeak-data directory
char path_home[N_PATH_HOME]; // this is the espeak-ng-data directory
extern int saved_parameters[N_SPEECH_PARAM]; // Parameters saved on synthesis start
static int dispatch_audio(short *outbuf, int length, espeak_EVENT *event)
@@ -272,7 +268,7 @@ int GetFileLength(const char *filename)
ESPEAK_NG_API void espeak_ng_InitializePath(const char *path)
{
if (path != NULL) {
sprintf(path_home, "%s/espeak-data", path);
sprintf(path_home, "%s/espeak-ng-data", path);
return;
}
@@ -284,9 +280,9 @@ ESPEAK_NG_API void espeak_ng_InitializePath(const char *path)
unsigned char buf[sizeof(path_home)-13];
if ((env = getenv("ESPEAK_DATA_PATH")) != NULL) {
sprintf(path_home, "%s/espeak-data", env);
sprintf(path_home, "%s/espeak-ng-data", env);
if (GetFileLength(path_home) == -2)
return; // an espeak-data directory exists
return; // an espeak-ng-data directory exists
}
buf[0] = 0;
@@ -295,7 +291,7 @@ ESPEAK_NG_API void espeak_ng_InitializePath(const char *path)
var_type = REG_SZ;
RegQueryValueExA(RegKey, "Path", 0, &var_type, buf, &size);
sprintf(path_home, "%s\\espeak-data", buf);
sprintf(path_home, "%s\\espeak-ng-data", buf);
#elif defined(PLATFORM_DOS)
strcpy(path_home, PATH_ESPEAK_DATA);
#else
@@ -303,12 +299,12 @@ ESPEAK_NG_API void espeak_ng_InitializePath(const char *path)
// check for environment variable
if ((env = getenv("ESPEAK_DATA_PATH")) != NULL) {
snprintf(path_home, sizeof(path_home), "%s/espeak-data", env);
snprintf(path_home, sizeof(path_home), "%s/espeak-ng-data", env);
if (GetFileLength(path_home) == -2)
return; // an espeak-data directory exists
return; // an espeak-ng-data directory exists
}
snprintf(path_home, sizeof(path_home), "%s/espeak-data", getenv("HOME"));
snprintf(path_home, sizeof(path_home), "%s/espeak-ng-data", getenv("HOME"));
if (access(path_home, R_OK) != 0)
strcpy(path_home, PATH_ESPEAK_DATA);
#endif
+2 -2
View File
@@ -52,7 +52,7 @@ extern "C"
// will look for espeak_data directory here, and also in user's home directory
#ifndef PATH_ESPEAK_DATA
#define PATH_ESPEAK_DATA "/usr/share/espeak-data"
#define PATH_ESPEAK_DATA "/usr/share/espeak-ng-data"
#endif
typedef unsigned short USHORT;
@@ -65,7 +65,7 @@ typedef struct {
} MNEM_TAB;
int LookupMnem(MNEM_TAB *table, const char *string);
extern char path_home[N_PATH_HOME]; // this is the espeak-data directory
extern char path_home[N_PATH_HOME]; // this is the espeak-ng-data directory
extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size);
extern ESPEAK_NG_API int GetFileLength(const char *filename);
+1 -1
View File
@@ -55,7 +55,7 @@ static int mbr_name_prefix = 0;
espeak_ng_STATUS LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int *srate)
{
// Load a phoneme name translation table from espeak-data/mbrola
// Load a phoneme name translation table from espeak-ng-data/mbrola
int size;
int ix;
+1 -1
View File
@@ -1228,7 +1228,7 @@ espeak_VOICE *SelectVoiceByName(espeak_VOICE **voices, const char *name2)
int match_fname = -1;
int match_fname2 = -1;
int match_name = -1;
const char *id; // this is the filename within espeak-data/voices
const char *id; // this is the filename within espeak-ng-data/voices
char *variant_name;
int last_part_len;
char last_part[41];