Merge branch 'master' into android

Conflicts:
	platforms/windows/make_espeakedit.iss
This commit is contained in:
Reece H. Dunn
2013-04-03 09:23:50 +01:00
79 changed files with 3071 additions and 1535 deletions
+3 -2
View File
@@ -2866,8 +2866,8 @@ int CompilePhoneme(int compile_phoneme)
break;
case i_ADD_LENGTH:
value = NextItem(tSIGNEDNUMBER);
*prog_out++ = (i_ADD_LENGTH << 8) + value/2;
value = NextItem(tSIGNEDNUMBER) / 2;
*prog_out++ = (i_ADD_LENGTH << 8) + (value & 0xff);
DecThenCount();
break;
@@ -3059,6 +3059,7 @@ int CompilePhoneme(int compile_phoneme)
case kRETURN:
*prog_out++ = i_RETURN;
DecThenCount();
break;
case kINCLUDE:
+20 -2
View File
@@ -3473,16 +3473,34 @@ int LookupDictList(Translator *tr, char **wordptr, char *ph_out, unsigned int *f
} // end of LookupDictList
extern char word_phonemes[N_WORD_PHONEMES]; // a word translated into phoneme codes
int Lookup(Translator *tr, const char *word, char *ph_out)
{//===================================================
int found;
unsigned int flags[2];
int say_as;
char *word1 = (char *)word;
char text[80];
flags[0] = 0;
flags[1] = FLAG_LOOKUP_SYMBOL;
char *word1 = (char *)word;
return(LookupDictList(tr, &word1, ph_out, flags, 0, NULL));
found = LookupDictList(tr, &word1, ph_out, flags, FLAG_ALLOW_TEXTMODE, NULL);
if(flags[0] & FLAG_TEXTMODE)
{
say_as = option_sayas;
option_sayas = 0; // don't speak replacement word as letter names
text[0] = 0;
strncpy0(&text[1], word1, sizeof(text));
found = TranslateWord(tr, &text[1], 0, NULL, NULL);
strcpy(ph_out, word_phonemes);
option_sayas = say_as;
}
return(found);
}
int LookupFlags(Translator *tr, const char *word)
{//==============================================
char buf[100];
+30 -3
View File
@@ -655,7 +655,7 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control)
current_alphabet = alphabet;
if((alphabet != NULL) && !(al_flags & AL_DONT_NAME) && (al_offset != translator->letter_bits_offset))
{
if((al_flags & AL_DONT_NAME) || (al_offset == translator->langopts.alt_alphabet))
if((al_flags & AL_DONT_NAME) || (al_offset == translator->langopts.alt_alphabet) || (al_offset == translator->langopts.our_alphabet))
{
// don't say the alphabet name
}
@@ -703,11 +703,38 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control)
else
language = L('e','n');
if(language != tr->translator_name)
if((language != tr->translator_name) || (language == L('k','o')))
{
char *p3;
int initial, code;
char hangul_buf[12];
// speak in the language for this alphabet (or English)
ph_buf[2] = SetTranslator2(WordToString2(language));
LookupLetter(translator2, letter, word[n_bytes], &ph_buf[3], control & 1);
if(((code = letter - 0xac00) >= 0) && (letter <= 0xd7af))
{
// Special case for Korean letters.
// break a syllable hangul into 2 or 3 individual jamo
hangul_buf[0] = ' ';
p3 = &hangul_buf[1];
if((initial = (code/28)/21) != 11)
{
p3 += utf8_out(initial + 0x1100, p3);
}
utf8_out(((code/28) % 21) + 0x1161, p3); // medial
utf8_out((code % 28) + 0x11a7, &p3[3]); // final
p3[6] = ' ';
p3[7] = 0;
ph_buf[3] = 0;
TranslateRules(translator2, &hangul_buf[1], &ph_buf[3], sizeof(ph_buf)-3, NULL, 0, NULL);
SetWordStress(translator2, &ph_buf[3], NULL, -1, 0);
}
else
{
LookupLetter(translator2, letter, word[n_bytes], &ph_buf[3], control & 1);
}
if(ph_buf[3] == phonSWITCH)
{
+59 -50
View File
@@ -125,6 +125,7 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
int delete_count;
int word_start;
int inserted;
int deleted;
PHONEME_DATA phdata;
int n_ph_list3;
@@ -343,6 +344,7 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
plist3 = &ph_list3[j];
inserted = 0;
deleted = 0;
if(insert_ph != 0)
{
// we have a (linking) phoneme which we need to insert here
@@ -431,23 +433,27 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
plist3->phcode = alternative;
if(alternative == 1)
continue; // NULL phoneme, discard
if(ph->type == phVOWEL)
{
plist3->synthflags |= SFLAG_SYLLABLE;
if(ph2->type != phVOWEL)
plist3->stresslevel = 0; // change from non-vowel to vowel, make sure it's unstressed
deleted = 1; // NULL phoneme, discard
}
else
plist3->synthflags &= ~SFLAG_SYLLABLE;
{
if(ph->type == phVOWEL)
{
plist3->synthflags |= SFLAG_SYLLABLE;
if(ph2->type != phVOWEL)
plist3->stresslevel = 0; // change from non-vowel to vowel, make sure it's unstressed
}
else
plist3->synthflags &= ~SFLAG_SYLLABLE;
// re-interpret the changed phoneme
// But it doesn't obey a second ChangePhoneme()
InterpretPhoneme(tr, 0x100, plist3, &phdata, &worddata);
// re-interpret the changed phoneme
// But it doesn't obey a second ChangePhoneme()
InterpretPhoneme(tr, 0x100, plist3, &phdata, &worddata);
}
}
if(ph->type == phVOWEL)
if((ph->type == phVOWEL) && (deleted == 0))
{
PHONEME_LIST *p;
@@ -552,7 +558,7 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
}
}
if(plist3 != plist3_inserted)
if((plist3 != plist3_inserted) && (ix > 0))
{
if((x = (tr->langopts.word_gap & 0x7)) != 0)
{
@@ -585,51 +591,54 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
// not yet implemented
}
phlist[ix].ph = ph;
phlist[ix].type = ph->type;
phlist[ix].env = PITCHfall; // default, can be changed in the "intonation" module
phlist[ix].synthflags = plist3->synthflags;
phlist[ix].stresslevel = plist3->stresslevel & 0xf;
phlist[ix].wordstress = plist3->wordstress;
phlist[ix].tone_ph = plist3->tone_ph;
phlist[ix].sourceix = 0;
phlist[ix].phcode = ph->code;
if(plist3->sourceix != 0)
if(deleted == 0)
{
phlist[ix].sourceix = plist3->sourceix;
phlist[ix].newword = 1; // this phoneme is the start of a word
phlist[ix].ph = ph;
phlist[ix].type = ph->type;
phlist[ix].env = PITCHfall; // default, can be changed in the "intonation" module
phlist[ix].synthflags = plist3->synthflags;
phlist[ix].stresslevel = plist3->stresslevel & 0xf;
phlist[ix].wordstress = plist3->wordstress;
phlist[ix].tone_ph = plist3->tone_ph;
phlist[ix].sourceix = 0;
phlist[ix].phcode = ph->code;
if(start_sentence)
if(plist3->sourceix != 0)
{
phlist[ix].newword = 5; // start of sentence + start of word
start_sentence = 0;
phlist[ix].sourceix = plist3->sourceix;
phlist[ix].newword = 1; // this phoneme is the start of a word
if(start_sentence)
{
phlist[ix].newword = 5; // start of sentence + start of word
start_sentence = 0;
}
}
else
{
phlist[ix].newword = 0;
}
}
else
{
phlist[ix].newword = 0;
}
// phlist[ix].length = ph->std_length;
phlist[ix].length = phdata.pd_param[i_SET_LENGTH]*2;
if((ph->code == phonPAUSE_LONG) && (option_wordgap > 0))
{
phlist[ix].ph = phoneme_tab[phonPAUSE_SHORT];
phlist[ix].length = option_wordgap*14; // 10mS per unit at the default speed
}
// phlist[ix].length = ph->std_length;
phlist[ix].length = phdata.pd_param[i_SET_LENGTH]*2;
if((ph->code == phonPAUSE_LONG) && (option_wordgap > 0) && (plist3[1].sourceix != 0))
{
phlist[ix].ph = phoneme_tab[phonPAUSE_SHORT];
phlist[ix].length = option_wordgap*14; // 10mS per unit at the default speed
}
if(ph->type==phVOWEL || ph->type==phLIQUID || ph->type==phNASAL || ph->type==phVSTOP || ph->type==phVFRICATIVE)
{
phlist[ix].length = 128; // length_mod
phlist[ix].env = PITCHfall;
}
if(ph->type==phVOWEL || ph->type==phLIQUID || ph->type==phNASAL || ph->type==phVSTOP || ph->type==phVFRICATIVE || (ph->phflags & phPREVOICE))
{
phlist[ix].length = 128; // length_mod
phlist[ix].env = PITCHfall;
}
phlist[ix].prepause = 0;
phlist[ix].amp = 20; // default, will be changed later
phlist[ix].pitch1 = 255;
phlist[ix].pitch2 = 255;
ix++;
phlist[ix].prepause = 0;
phlist[ix].amp = 20; // default, will be changed later
phlist[ix].pitch1 = 255;
phlist[ix].pitch2 = 255;
ix++;
}
}
phlist[ix].newword = 2; // end of clause
+2
View File
@@ -90,6 +90,7 @@ static const unsigned short punct_chars[] = {',','.','?','!',':',';',
0x055e, // Armenian question
0x055b, // Armenian emphasis mark
0x060c, // Arabic ,
0x061b, // Arabic ;
0x061f, // Arabic ?
0x06d4, // Arabic .
@@ -137,6 +138,7 @@ static const unsigned int punct_attributes [] = { 0,
CLAUSE_QUESTION | PUNCT_IN_WORD, // Armenian question
CLAUSE_PERIOD | PUNCT_IN_WORD, // Armenian emphasis mark
CLAUSE_COMMA, // Arabic ,
CLAUSE_SEMICOLON, // Arabic ;
CLAUSE_QUESTION, // Arabic question mark
CLAUSE_PERIOD, // Arabic full stop
+24 -4
View File
@@ -575,6 +575,7 @@ void CalcLengths(Translator *tr)
int last_pitch = 0;
int pitch_start;
int length_mod;
int next2type;
int len;
int env2;
int end_of_clause;
@@ -689,8 +690,19 @@ void CalcLengths(Translator *tr)
p->prepause = 40;
if((prev->type == phPAUSE) || (prev->type == phVOWEL)) // || (prev->ph->mnemonic == ('/'*256+'r')))
p->prepause = 0;
if(prev->type == phVOWEL)
{
p->prepause = 0; // use murmur instead to link from the preceding vowel
}
else
if(prev->type == phPAUSE)
{
// reduce by the length of the preceding pause
if(prev->length < p->prepause)
p->prepause -= prev->length;
else
p->prepause = 0;
}
else
if(p->newword==0)
{
@@ -827,9 +839,17 @@ if(stress <= 1)
next3 = &phoneme_list[ix+4];
}
next2type = next2->ph->length_mod;
if(more_syllables==0)
{
len = tr->langopts.length_mods0[next2->ph->length_mod *10+ next->ph->length_mod];
if(next->newword || next2->newword)
{
// don't use 2nd phoneme over a word boundary, unless it's a pause
if(next2type != 1)
next2type = 0;
}
len = tr->langopts.length_mods0[next2type *10+ next->ph->length_mod];
if((next->newword) && (tr->langopts.word_gap & 0x20))
{
@@ -841,7 +861,7 @@ if(stress <= 1)
}
else
{
length_mod = tr->langopts.length_mods[next2->ph->length_mod *10+ next->ph->length_mod];
length_mod = tr->langopts.length_mods[next2type *10+ next->ph->length_mod];
if((next->type == phNASAL) && (next2->type == phSTOP || next2->type == phVSTOP) && (next3->ph->phflags & phFORTIS))
length_mod -= 15;
+11 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.47.03c 23.Mar.13";
const char *version_string = "1.47.04 02.Apr.13";
const int version_phdata = 0x014701;
int option_device_number = -1;
@@ -1032,6 +1032,16 @@ void InterpretPhoneme(Translator *tr, int control, PHONEME_LIST *plist, PHONEME_
phdata->pd_param[i_APPEND_PHONEME] = data;
}
else
if(instn2 == i_ADD_LENGTH)
{
if(data & 0x80)
{
// a negative value, do sign extension
data = -(0x100 - data);
}
phdata->pd_param[i_SET_LENGTH] += data;
}
else
if(instn2 == i_IPA_NAME)
{
// followed by utf-8 characters, 2 per instn word
+19 -1
View File
@@ -1426,7 +1426,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
EndAmplitude();
if(p->prepause > 0)
if((p->prepause > 0) && !(p->ph->phflags & phPREVOICE))
DoPause(p->prepause,1);
done_phoneme_marker = 0;
@@ -1455,6 +1455,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
case phSTOP:
released = 0;
ph = p->ph;
if(next->type==phVOWEL)
{
released = 1;
@@ -1468,6 +1469,23 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
if(released == 0)
p->synthflags |= SFLAG_NEXT_PAUSE;
if(ph->phflags & phPREVOICE)
{
// a period of voicing before the release
memset(&fmtp, 0, sizeof(fmtp));
InterpretPhoneme(NULL, 0x01, p, &phdata, &worddata);
fmtp.fmt_addr = phdata.sound_addr[pd_FMT];
fmtp.fmt_amp = phdata.sound_param[pd_FMT];
if(last_pitch_cmd < 0)
{
DoAmplitude(next->amp,NULL);
DoPitch(envelope_data[p->env],next->pitch1,next->pitch2);
}
DoSpect2(ph, 0, &fmtp, p, 0);
}
InterpretPhoneme(NULL, 0, p, &phdata, &worddata);
phdata.pd_control |= pd_DONTLENGTHEN;
DoSample3(&phdata, 0, 0);
+12 -7
View File
@@ -79,7 +79,7 @@ ALPHABET alphabets [] = {
{"_ar", OFFSET_ARABIC, 0x600, 0x6ff, 0, 0},
{"_dv", OFFSET_THAANA, 0x780, 0x7bf, 0, 0},
{"_hi", OFFSET_DEVANAGARI, 0x900, 0x97f,L('h','i'), AL_WORDS},
{"_bn", OFFSET_BENGALI, 0x0980, 0x9ff, 0, 0},
{"_bn", OFFSET_BENGALI, 0x0980, 0x9ff, L('b','n'), 0},
{"_gur", OFFSET_GURMUKHI, 0xa00, 0xa7f, L('p','a'), AL_WORDS},
{"_gu", OFFSET_GUJARATI, 0xa80, 0xaff, 0, 0},
{"_or", OFFSET_ORIYA, 0xb00, 0xb7f, 0, 0},
@@ -93,12 +93,12 @@ ALPHABET alphabets [] = {
{"_ti", OFFSET_TIBET, 0xf00, 0xfff, 0, 0},
{"_my", OFFSET_MYANMAR, 0x1000,0x109f, 0, 0},
{"_ka", OFFSET_GEORGIAN, 0x10a0,0x10ff, L('k','a'), AL_WORDS},
{"_ko", OFFSET_KOREAN, 0x1100,0x11ff, 0, 0},
{"_ko", OFFSET_KOREAN, 0x1100,0x11ff, L('k','o'), AL_WORDS},
{"_eth", OFFSET_ETHIOPIC, 0x1200,0x139f, 0, 0},
{"_braille", 0x2800, 0x2800,0x28ff, 0, AL_NO_SYMBOL},
{"_ja", 0x3040, 0x3040,0x30ff, 0, AL_NOT_CODE},
{"_zh", 0x3100, 0x3100,0x9fff, 0, AL_NOT_CODE},
{"_ko", 0xa700, 0xa700,0xd7ff, 0, AL_NOT_CODE},
{"_ko", 0xa700, 0xa700,0xd7ff, L('k','o'), AL_NOT_CODE | AL_WORDS},
{NULL, 0, 0, 0, 0, 0}
};
@@ -518,6 +518,7 @@ Translator *SelectTranslator(const char *name)
{
SetCyrillicLetters(tr);
SetLetterVowel(tr,0x2a);
tr->charset_a0 = charsets[5]; // ISO-8859-5
tr->langopts.param[LOPT_UNPRONOUNCABLE] = 0x432; // [v] don't count this character at start of word
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x107; // devoice at end of word, and change voicing to match a following consonant (except v)
tr->langopts.param[LOPT_REDUCE] = 2;
@@ -654,10 +655,10 @@ Translator *SelectTranslator(const char *name)
// character codes offset by 0x380
static const char el_vowels[] = {0x10,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x35,0x37,0x39,0x3f,0x45,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0};
static const char el_fvowels[] = {0x2d,0x2e,0x2f,0x35,0x37,0x39,0x45,0x4d,0}; // ε η ι υ έ ή ί ύ
static const char el_voiceless[]= {0x38,0x3a,0x3e,0x40,0x42,0x43,0x44,0x46,0x47,0}; // θ κ ξ π ς σ τ φ χ
static const char el_fvowels[] = {0x2d,0x2e,0x2f,0x35,0x37,0x39,0x45,0x4d,0}; // ε η ι υ έ ή ί ύ _
static const char el_voiceless[]= {0x38,0x3a,0x3e,0x40,0x42,0x43,0x44,0x46,0x47,0}; // θ κ ξ π ς σ τ φ χ _
static const char el_consonants[]={0x32,0x33,0x34,0x36,0x38,0x3a,0x3b,0x3c,0x3d,0x3e,0x40,0x41,0x42,0x43,0x44,0x46,0x47,0x48,0};
static const wchar_t el_char_apostrophe[] = {0x3c3,0}; // σ
static const wchar_t el_char_apostrophe[] = {0x3c3,0}; // σ _
SetupTranslator(tr,stress_lengths_el,stress_amps_el);
@@ -670,7 +671,7 @@ Translator *SelectTranslator(const char *name)
SetLetterBits(tr,LETTERGP_VOWEL2,el_vowels);
SetLetterBits(tr,LETTERGP_B,el_voiceless);
SetLetterBits(tr,LETTERGP_C,el_consonants);
SetLetterBits(tr,LETTERGP_Y,el_fvowels); // front vowels: ε η ι υ
SetLetterBits(tr,LETTERGP_Y,el_fvowels); // front vowels: ε η ι υ _
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = STRESSPOSN_2R;
@@ -912,6 +913,7 @@ SetupTranslator(tr,stress_lengths_equal,stress_amps_equal);
tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_DECIMAL_COMMA | NUM_THOUS_SPACE | NUM_DFRACTION_2 | NUM_ROMAN_CAPITALS;
tr->langopts.numbers2 = 0xa + NUM2_THOUSANDS_VAR5; // variant numbers before thousands,milliards
tr->langopts.replace_chars = replace_cyrillic_latin;
tr->langopts.our_alphabet = OFFSET_CYRILLIC; // don't say "cyrillic" before letter names
SetLetterVowel(tr,'y');
SetLetterVowel(tr,'r');
@@ -1113,6 +1115,7 @@ SetLengthMods(tr,3); // all equal
static const unsigned char ko_voiced[] = {0x02,0x05,0x06,0xab,0xaf,0xb7,0xbc,0}; // voiced consonants, l,m,n,N
tr->letter_bits_offset = OFFSET_KOREAN;
tr->langopts.our_alphabet = 0xa700;
memset(tr->letter_bits,0,sizeof(tr->letter_bits));
SetLetterBitsRange(tr,LETTERGP_A,0x61,0x75);
SetLetterBits(tr,LETTERGP_Y,ko_ivowels);
@@ -1194,6 +1197,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_mk,stress_amps_mk);
tr->charset_a0 = charsets[5]; // ISO-8859-5
tr->letter_groups[0] = tr->letter_groups[7] = vowels_cyrillic;
tr->letter_bits_offset = OFFSET_CYRILLIC;
tr->langopts.stress_rule = STRESSPOSN_3R; // antipenultimate
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_DFRACTION_2;
@@ -1608,6 +1612,7 @@ SetLengthMods(tr,3); // all equal
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.tone_numbers = 1; // a number after letters indicates a tone number (eg. pinyin or jyutping)
tr->langopts.ideographs = 1;
tr->langopts.our_alphabet = 0x3100;
tr->langopts.word_gap = 0x21; // length of a final vowel is less dependent on the next consonant, don't merge consonant with next word
if(name2 == L('z','h'))
{
+33 -32
View File
@@ -1736,6 +1736,7 @@ int SetTranslator2(const char *new_language)
translator2->phoneme_tab_ix = new_phoneme_tab;
}
}
translator2->phonemes_repeat[0] = 0;
return(new_phoneme_tab);
} // end of SetTranslator2
@@ -2444,6 +2445,35 @@ static int TranslateChar(Translator *tr, char *ptr, int prev_in, unsigned int c,
0x72,0x73,0x74,0x75
};
// check for Korean Hangul letters
if(((code = c - 0xac00) >= 0) && (c <= 0xd7af))
{
// break a syllable hangul into 2 or 3 individual jamo
initial = (code/28)/21;
medial = (code/28) % 21;
final = code % 28;
if(initial == 11)
{
// null initial
c = medial + 0x1161;
if(final > 0)
*insert = final + 0x11a7;
}
else
{
// extact the initial and insert the remainder with a null initial
c = initial + 0x1100;
*insert = (11*28*21) + (medial*28) + final + 0xac00;
}
return(c);
}
else if(((code = c - 0x3130) >= 0) && (code < 0x34))
{
// Hangul compatibility jamo
return(hangul_compatibility[code] + 0x1100);
}
switch(tr->translator_name)
{
case L('a','f'):
@@ -2471,36 +2501,6 @@ static int TranslateChar(Translator *tr, char *ptr, int prev_in, unsigned int c,
}
}
break;
case L('k','o'):
if(((code = c - 0xac00) >= 0) && (c <= 0xd7af))
{
// break a syllable hangul into 2 or 3 individual jamo
initial = (code/28)/21;
medial = (code/28) % 21;
final = code % 28;
if(initial == 11)
{
// null initial
c = medial + 0x1161;
if(final > 0)
*insert = final + 0x11a7;
}
else
{
// extact the initial and insert the remainder with a null initial
c = initial + 0x1100;
*insert = (11*28*21) + (medial*28) + final + 0xac00;
}
return(c);
}
else if(((code = c - 0x3130) >= 0) && (code < 0x34))
{
// Hangul compatibility jamo
return(hangul_compatibility[code] + 0x1100);
}
break;
}
return(SubstituteChar(tr, c, next_in, insert, wordflags));
}
@@ -2955,7 +2955,7 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre
}
else
{
if(iswlower(prev_in))
if((iswlower(prev_in)) && (prev_in != 0xba)) // Windows thinks masc.ordinal (0xba) is lower-case
{
// lower case followed by upper case in a word
if(UpperCaseInWord(tr, &sbuf[ix], c) == 1)
@@ -3473,7 +3473,8 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre
prev_clause_pause = clause_pause;
*tone_out = tone;
if(tone_out != NULL)
*tone_out = tone;
new_sentence = 0;
if(terminator & CLAUSE_BIT_SENTENCE)
+1
View File
@@ -546,6 +546,7 @@ typedef struct {
int listx; // compile *_listx after *list
const unsigned int *replace_chars; // characters to be substitutes
char ascii_language[8]; // switch to this language for Latin characters
int our_alphabet; // offset for main alphabet (if not set in letter_bits_offset)
int alt_alphabet; // offset for another language to recognize
int alt_alphabet_lang; // language for the alt_alphabet
int max_lengthmod;
+15 -4
View File
@@ -602,7 +602,7 @@ voice_t *LoadVoice(const char *vname, int control)
// which directory to look for a named voice. List of voice names, must end in a space.
static const char *voices_asia =
"fa fa-pin hi hy hy-west id ka kn ku ml ms ne pa ta tr vi vi-hue zh zh-yue ";
"bn fa fa-pin hi hy hy-west id ka kn ku ml ms ne pa ta te tr vi vi-hue zh zh-yue ";
static const char *voices_europe =
"an bg bs ca cs cy da de el en en-us es et fi fr fr-be ga hr hu is it lt lv mk nl no pl pt-pt ro ru sk sq sr sv ";
@@ -1894,12 +1894,24 @@ void FreeVoiceList()
ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec)
{//========================================================================
#ifndef PLATFORM_RISCOS
char path_voices[sizeof(path_home)+12];
#ifdef PLATFORM_RISCOS
if(n_voices_list == 0)
{
sprintf(path_voices,"%s%cvoices",path_home,PATHSEP);
len_path_voices = strlen(path_voices)+1;
GetVoices(path_voices);
voices_list[n_voices_list] = NULL; // voices list terminator
}
return((const espeak_VOICE **)voices_list);
#else
int ix;
int j;
espeak_VOICE *v;
static espeak_VOICE **voices = NULL;
char path_voices[sizeof(path_home)+12];
// free previous voice list data
FreeVoiceList();
@@ -1938,7 +1950,6 @@ ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec)
}
return((const espeak_VOICE **)voices);
#endif
return((const espeak_VOICE **)voices_list);
} // end of espeak_ListVoices