mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
[1.28.03] Added macro in speech.h for max. length of the espeak-data path.
Added language: "bs" Bosnian. Fix to speak_lib.h for Windows dll version. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@69 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+128
-3
@@ -34,6 +34,7 @@
|
||||
#include "synthesize.h"
|
||||
#include "translate.h"
|
||||
|
||||
#include <locale.h>
|
||||
#define N_XML_BUF 256
|
||||
|
||||
espeak_VOICE *SelectVoice(espeak_VOICE *voice_select, int *variant);
|
||||
@@ -151,7 +152,131 @@ const int param_defaults[N_SPEECH_PARAM] = {
|
||||
};
|
||||
|
||||
|
||||
#ifdef PLATFORM_RISCOS
|
||||
#ifdef NEED_WCHAR_FUNCTIONS
|
||||
|
||||
// additional Latin characters beyond the Latin1 character set
|
||||
#define MAX_WALPHA 0x233
|
||||
// indexed by character - 0x100
|
||||
// 0=not alphabetic, 0xff=lower case, other=value to add to upper case to convert to lower case
|
||||
static unsigned char walpha_tab[MAX_WALPHA-0xff] = {
|
||||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 100
|
||||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 110
|
||||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 120
|
||||
0xff,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, 1,0xff, 1,0xff, 1, // 130
|
||||
0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, 1,0xff, 1,0xff, // 140
|
||||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 150
|
||||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 160
|
||||
1,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, // 170
|
||||
0xff, 210, 1,0xff, 1,0xff, 206, 1,0xff, 205, 205, 1,0xff,0xff, 79, 202, // 180
|
||||
203, 1,0xff, 205, 207,0xff, 211, 209, 1,0xff,0xff,0xff, 211, 213,0xff, 214, // 190
|
||||
1,0xff, 1,0xff, 1,0xff, 218, 1,0xff, 218,0xff,0xff, 1,0xff, 218, 1, // 1a0
|
||||
0xff, 217, 217, 1,0xff, 1,0xff, 219, 1,0xff,0xff,0xff, 1,0xff,0xff,0xff, // 1b0
|
||||
0xff,0xff,0xff,0xff, 2, 1,0xff, 2, 1,0xff, 2, 1,0xff, 1,0xff, 1, // 1c0
|
||||
0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff,0xff, 1,0xff, // 1d0
|
||||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 1e0
|
||||
0xff, 2, 1,0xff, 1,0xff,0xff,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 1f0
|
||||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 200
|
||||
1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 210
|
||||
0xff, 0, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, 1,0xff, // 220
|
||||
1,0xff, 1,0xff }; // 230
|
||||
|
||||
// use ctype.h functions for Latin1 (character < 0x100)
|
||||
int iswalpha(int c)
|
||||
{
|
||||
if(c < 0x100)
|
||||
return(isalpha(c));
|
||||
if(c > MAX_WALPHA)
|
||||
return(0);
|
||||
return(walpha_tab[c-0x100]);
|
||||
}
|
||||
|
||||
int iswdigit(int c)
|
||||
{
|
||||
if(c < 0x100)
|
||||
return(isdigit(c));
|
||||
return(0);
|
||||
}
|
||||
|
||||
int iswalnum(int c)
|
||||
{
|
||||
if(iswdigit(c))
|
||||
return(1);
|
||||
return(iswalpha(c));
|
||||
}
|
||||
|
||||
int towlower(int c)
|
||||
{
|
||||
int x;
|
||||
if(c < 0x100)
|
||||
return(tolower(c));
|
||||
if((c > MAX_WALPHA) || ((x = walpha_tab[c-0x100])==0xff))
|
||||
return(c); // already lower case
|
||||
return(c + x); // convert to lower case
|
||||
}
|
||||
|
||||
int towupper(int c)
|
||||
{
|
||||
// check whether the previous character code is the upper-case equivalent of this character
|
||||
if(tolower(c-1) == c)
|
||||
return(c-1); // yes, use it
|
||||
return(c); // no
|
||||
}
|
||||
|
||||
int iswupper(int c)
|
||||
{
|
||||
int x;
|
||||
if(c < 0x100)
|
||||
return(isupper(c));
|
||||
if(((c > MAX_WALPHA) || (x = walpha_tab[c-0x100])==0) || (x == 0xff))
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
int iswlower(int c)
|
||||
{
|
||||
if(c < 0x100)
|
||||
return(islower(c));
|
||||
if((c > MAX_WALPHA) || (walpha_tab[c-0x100] != 0xff))
|
||||
return(0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
int iswspace(int c)
|
||||
{
|
||||
if(c < 0x100)
|
||||
return(isspace(c));
|
||||
return(0);
|
||||
}
|
||||
|
||||
int iswpunct(int c)
|
||||
{
|
||||
if(c < 0x100)
|
||||
return(ispunct(c));
|
||||
return(0);
|
||||
}
|
||||
|
||||
const wchar_t *wcschr(const wchar_t *str, int c)
|
||||
{
|
||||
while(*str != 0)
|
||||
{
|
||||
if(*str == c)
|
||||
return(str);
|
||||
str++;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
const int wcslen(const wchar_t *str)
|
||||
{
|
||||
int ix=0;
|
||||
|
||||
while(*str != 0)
|
||||
{
|
||||
ix++;
|
||||
}
|
||||
return(ix);
|
||||
}
|
||||
|
||||
float wcstod(const wchar_t *str, wchar_t **tailptr)
|
||||
{
|
||||
int ix;
|
||||
@@ -395,8 +520,8 @@ static int LoadSoundFile(const char *fname, int index)
|
||||
int *ip;
|
||||
int length;
|
||||
char fname_temp[100];
|
||||
char fname2[200];
|
||||
char command[150];
|
||||
char fname2[sizeof(path_home)+13+40];
|
||||
char command[sizeof(fname2)+sizeof(fname2)+30];
|
||||
|
||||
if(fname == NULL)
|
||||
fname = soundicon_tab[index].filename;
|
||||
|
||||
Reference in New Issue
Block a user