mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
[1.28.04] espeakedit: look for environment variable ESPEAK_DATA_PATH
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@72 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+19
-8
@@ -125,21 +125,32 @@ void ConfigInit()
|
||||
const char *path_base;
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
int found = 0;
|
||||
char buf[200];
|
||||
wxRegKey *pRegKey = new wxRegKey(_T("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Speech\\Voices\\Tokens\\eSpeak"));
|
||||
|
||||
if(pRegKey->Exists() )
|
||||
if((path_base = getenv("ESPEAK_DATA_PATH")) != NULL)
|
||||
{
|
||||
wxString RegVal;
|
||||
pRegKey->QueryValue(_T("Path"),RegVal);
|
||||
strncpy0(buf,RegVal.mb_str(wxConvLocal),sizeof(buf));
|
||||
path_base = buf;
|
||||
sprintf(path_home,"%s\\espeak-data",path_base);
|
||||
if(GetFileLength(path_home) == -2)
|
||||
found = 1; // an espeak-data directory exists
|
||||
}
|
||||
else
|
||||
|
||||
if(found == 0)
|
||||
{
|
||||
path_base = "C:\\Program Files\\eSpeak";
|
||||
if(pRegKey->Exists() )
|
||||
{
|
||||
wxString RegVal;
|
||||
pRegKey->QueryValue(_T("Path"),RegVal);
|
||||
strncpy0(buf,RegVal.mb_str(wxConvLocal),sizeof(buf));
|
||||
path_base = buf;
|
||||
}
|
||||
else
|
||||
{
|
||||
path_base = "C:\\Program Files\\eSpeak";
|
||||
}
|
||||
sprintf(path_home,"%s\\espeak-data",path_base);
|
||||
}
|
||||
sprintf(path_home,"%s\\espeak-data",path_base);
|
||||
#else
|
||||
snprintf(path_home,sizeof(path_home),"%s/espeak-data",getenv("HOME"));
|
||||
path_base = path_home;
|
||||
|
||||
Reference in New Issue
Block a user