[1.41.18]

*_list: Changed name to $combine (from $alt2) for the attribute which indicates that a word should combine with the next word.

Voices files: Added attribute "speed", which specified a percentage change to the speaking speeds which are used for this voice.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@229 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2009-10-19 11:10:05 +00:00
parent 7fc0ab97e1
commit 075bfe9006
27 changed files with 216 additions and 151 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ MNEM_TAB mnem_flags[] = {
{"$double", 19}, // IT double the initial consonant of next word
{"$alt", 20}, // use alternative pronunciation
{"$alt2", 21},
{"$combine", 22}, // Combine with the next word
{"$max3", 27}, // limit to 3 repetitions
{"$brk", 28}, // a shorter $pause
+11
View File
@@ -1167,6 +1167,17 @@ void SetWordStress(Translator *tr, char *output, unsigned int &dictionary_flags,
}
break;
case 10: // penultimate, but final if only 1 or 2 syllables
if(stressed_syllable == 0)
{
if(vowel_count < 4)
{
vowel_stress[vowel_count - 1] = 4;
max_stress = 4;
break;
}
}
// drop through to next case
case 2:
// a language with stress on penultimate vowel
+14 -1
View File
@@ -116,6 +116,11 @@ void SetSpeed(int control)
wpm = embedded_value[EMBED_S];
if(control == 2)
wpm = embedded_value[EMBED_S2];
if(voice->speed_percent > 0)
{
wpm = (wpm * voice->speed_percent)/100;
}
wpm2 = wpm;
if(wpm > 369) wpm = 369;
@@ -561,7 +566,7 @@ void CalcLengths(Translator *tr)
if((len = tr->stress_lengths[stress]) == 0)
len = tr->stress_lengths[6];
length_mod = (length_mod * len)/128;
length_mod = length_mod * len;
if(p->tone_ph != 0)
{
@@ -581,6 +586,14 @@ void CalcLengths(Translator *tr)
length_mod = length_mod * (256 + (280 - len)/3)/256;
}
if(length_mod > tr->langopts.max_lengthmod*speed1)
{
//limit the vowel length adjustment for some languages
length_mod = (tr->langopts.max_lengthmod*speed1);
}
length_mod = length_mod / 128;
if(p->type != phVOWEL)
{
length_mod = 256; // syllabic consonant
+2 -2
View File
@@ -35,8 +35,8 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.41.17 15.Oct.09";
const int version_phdata = 0x014100;
const char *version_string = "1.41.18 19.Oct.09";
const int version_phdata = 0x014118;
int option_device_number = -1;
-4
View File
@@ -1275,11 +1275,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
}
else
{
// if((prev->type != phVOWEL) && ((prev->ph->phflags & phVOICED)==0) && ((next->ph->phflags & phVOICED)==0))
// DoSpect(p->ph,prev->ph,phoneme_tab[phonPAUSE_SHORT],2,p,0);
// else
DoSpect(p->ph,prev->ph,phoneme_tab[phonPAUSE],2,p,0);
// DoSpect(p->ph,prev->ph,next->ph,2,p,0);
}
break;
+42 -48
View File
@@ -146,8 +146,9 @@ static Translator* NewTranslator(void)
tr->stress_lengths[ix] = stress_lengths2[ix];
}
memset(&(tr->langopts),0,sizeof(tr->langopts));
tr->langopts.max_lengthmod = 500;
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.unstressed_wd1 = 1;
tr->langopts.unstressed_wd2 = 3;
tr->langopts.param[LOPT_SONORANT_MIN] = 95;
@@ -260,7 +261,7 @@ Translator *SelectTranslator(const char *name)
static const short stress_lengths_af[8] = {170,140, 220,220, 0, 0, 250,270};
SetupTranslator(tr,stress_lengths_af,NULL);
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.vowel_pause = 0x30;
tr->langopts.param[LOPT_DIERESES] = 1;
tr->langopts.param[LOPT_PREFIXES] = 1;
@@ -279,7 +280,7 @@ Translator *SelectTranslator(const char *name)
SetupTranslator(tr,stress_lengths_bn,stress_amps_bn);
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable
tr->letter_bits_offset = OFFSET_BENGALI;
SetIndicLetters(tr); // call this after setting OFFSET_BENGALI
@@ -299,7 +300,7 @@ Translator *SelectTranslator(const char *name)
tr->charset_a0 = charsets[14]; // ISO-8859-14
// tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
// tr->langopts.intonation_group = 4;
// 'diminished' is an unstressed final syllable
@@ -320,7 +321,7 @@ Translator *SelectTranslator(const char *name)
static const short stress_lengths_da[8] = {160,140, 200,200, 0,0, 220,210};
SetupTranslator(tr,stress_lengths_da,NULL);
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
SetLetterVowel(tr,'y');
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_SWAP_TENS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_ORDINAL_DOT | NUM_1900;
}
@@ -330,7 +331,7 @@ Translator *SelectTranslator(const char *name)
case L('d','e'):
{
static const short stress_lengths_de[8] = {150,130, 200,200, 0, 0, 260,275};
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.word_gap = 0x8; // don't use linking phonemes
tr->langopts.vowel_pause = 0x30;
tr->langopts.param[LOPT_PREFIXES] = 1;
@@ -346,7 +347,7 @@ Translator *SelectTranslator(const char *name)
static const short stress_lengths_en[8] = {182,140, 220,220, 0,0, 248,275};
SetupTranslator(tr,stress_lengths_en,NULL);
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.numbers = NUM_HUNDRED_AND | NUM_ROMAN | NUM_1900;
tr->langopts.param[LOPT_COMBINE_WORDS] = 2; // allow "mc" to cmbine with the following word
}
@@ -378,7 +379,7 @@ Translator *SelectTranslator(const char *name)
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 = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x6; // mark unstressed final syllables as diminished
tr->langopts.unstressed_wd1 = 0;
tr->langopts.unstressed_wd2 = 2;
@@ -408,7 +409,7 @@ Translator *SelectTranslator(const char *name)
tr->langopts.word_gap = 1;
tr->langopts.vowel_pause = 2;
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x6 | 0x10;
tr->langopts.unstressed_wd1 = 3;
tr->langopts.unstressed_wd2 = 2;
@@ -429,7 +430,7 @@ Translator *SelectTranslator(const char *name)
SetupTranslator(tr,stress_lengths_es,stress_amps_es);
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
// stress last syllable if it doesn't end in vowel or "s" or "n"
// 'diminished' is an unstressed final syllable
@@ -459,7 +460,7 @@ Translator *SelectTranslator(const char *name)
static const short stress_lengths_eu[8] = {200, 200, 200, 200, 0, 0, 210, 230}; // very weak stress
static const unsigned char stress_amps_eu[8] = {16,16, 18,18, 18,18, 18,18 };
SetupTranslator(tr,stress_lengths_eu,stress_amps_eu);
tr->langopts.stress_rule = 1; // ?? second syllable ??
tr->langopts.stress_rule = STRESSPOSN_2L; // ?? second syllable ??
tr->langopts.numbers = NUM_SINGLE_STRESS + NUM_DECIMAL_COMMA | NUM_AND_UNITS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_VIGESIMAL;
}
break;
@@ -479,7 +480,7 @@ Translator *SelectTranslator(const char *name)
SetupTranslator(tr,stress_lengths_fi,stress_amps_fi);
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x56; // move secondary stress from light to a following heavy syllable
tr->langopts.param[LOPT_IT_DOUBLING] = 1;
tr->langopts.long_stop = 130;
@@ -499,7 +500,7 @@ Translator *SelectTranslator(const char *name)
static const unsigned char stress_amps_fr[8] = {18,16, 20,20, 20,22, 22,21 };
SetupTranslator(tr,stress_lengths_fr,stress_amps_fr);
tr->langopts.stress_rule = 3; // stress on final syllable
tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable
tr->langopts.stress_flags = 0x0024; // don't use secondary stress
tr->langopts.param[LOPT_IT_LENGTHEN] = 1; // remove lengthen indicator from unstressed syllables
@@ -508,14 +509,6 @@ Translator *SelectTranslator(const char *name)
}
break;
#ifdef deleted
case L('g','a'): // Irish Gaelic
{
tr->langopts.stress_rule = 1;
}
break;
#endif
case L('h','i'): // Hindi
case L('n','e'): // Nepali
case L('p','a'): // Punjabi
@@ -556,7 +549,7 @@ Translator *SelectTranslator(const char *name)
SetupTranslator(tr,stress_lengths_hr,stress_amps_hr);
tr->charset_a0 = charsets[2]; // ISO-8859-2
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x10;
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
tr->langopts.max_initial_consonants = 5;
@@ -582,12 +575,12 @@ Translator *SelectTranslator(const char *name)
tr->charset_a0 = charsets[2]; // ISO-8859-2
tr->langopts.vowel_pause = 0x20;
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x8036;
tr->langopts.unstressed_wd1 = 2;
// tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x4; // don't propagate over word boundaries
tr->langopts.param[LOPT_IT_DOUBLING] = 1;
tr->langopts.param[LOPT_COMBINE_WORDS] = 99; // combine some prepositions with the following word
// tr->langopts.param[LOPT_COMBINE_WORDS] = 9; // combine some prepositions with the following word
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_DFRACTION_5 | NUM_ROMAN | NUM_ROMAN_ORDINAL | NUM_ROMAN_CAPITALS | NUM_ORDINAL_DOT | NUM_OMIT_1_HUNDRED;
tr->langopts.min_roman = 1;
@@ -605,7 +598,7 @@ SetLengthMods(tr,3); // all equal
0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x56,0};
SetupTranslator(tr,stress_lengths_hy,NULL);
tr->langopts.stress_rule = 3; // default stress on final syllable
tr->langopts.stress_rule = STRESSPOSN_1R; // default stress on final syllable
tr->letter_bits_offset = OFFSET_ARMENIAN;
memset(tr->letter_bits,0,sizeof(tr->letter_bits));
@@ -623,7 +616,7 @@ SetLengthMods(tr,3); // all equal
static const unsigned char stress_amps_id[8] = {16,18, 18,18, 20,22, 22,21 };
SetupTranslator(tr,stress_lengths_id,stress_amps_id);
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_ROMAN;
tr->langopts.stress_flags = 0x6 | 0x10;
tr->langopts.accents = 2; // "capital" after letter name
@@ -636,7 +629,7 @@ SetLengthMods(tr,3); // all equal
static const wchar_t is_lettergroup_B[] = {'c','f','h','k','p','t','x',0xfe,0}; // voiceless conants, including 'þ' ?? 's'
SetupTranslator(tr,stress_lengths_is,NULL);
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x10;
tr->langopts.param[LOPT_IT_LENGTHEN] = 0x11; // remove lengthen indicator from unstressed vowels
tr->langopts.param[LOPT_REDUCE] = 2;
@@ -659,7 +652,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_it,stress_amps_it);
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x10 | 0x20000;
tr->langopts.vowel_pause = 1;
tr->langopts.unstressed_wd1 = 2;
@@ -681,12 +674,13 @@ SetLengthMods(tr,3); // all equal
static const wchar_t jbo_punct_within_word[] = {'.',',','\'',0x2c8,0}; // allow period and comma within a word, also stress marker (from LOPT_CAPS_IN_WORD)
SetupTranslator(tr,stress_lengths_jbo,NULL);
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.vowel_pause = 0x20c; // pause before a word which starts with a vowel, or after a word which ends in a consonant
// tr->langopts.word_gap = 1;
tr->punct_within_word = jbo_punct_within_word;
tr->langopts.param[LOPT_CAPS_IN_WORD] = 2; // capitals indicate stressed syllables
SetLetterVowel(tr,'y');
tr->langopts.max_lengthmod = 368;
}
break;
@@ -725,7 +719,7 @@ SetLengthMods(tr,3); // all equal
case L('l','a'): //Latin
{
tr->charset_a0 = charsets[4]; // ISO-8859-4, includes a,e,i,o,u-macron
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x20;
tr->langopts.unstressed_wd1 = 0;
tr->langopts.unstressed_wd2 = 2;
@@ -742,7 +736,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_lv,stress_amps_lv);
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.spelling_stress = 1;
tr->charset_a0 = charsets[4]; // ISO-8859-4
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_4 | NUM_ORDINAL_DOT;
@@ -761,7 +755,7 @@ SetLengthMods(tr,3); // all equal
tr->charset_a0 = charsets[5]; // ISO-8859-5
tr->letter_groups[0] = vowels_cyrillic;
tr->langopts.stress_rule = 4; // antipenultimate
tr->langopts.stress_rule = STRESSPOSN_3R; // antipenultimate
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2;
tr->langopts.numbers2 = 0x8a; // variant numbers before thousands,milliards
}
@@ -772,7 +766,7 @@ SetLengthMods(tr,3); // all equal
{
static const short stress_lengths_nl[8] = {160,135, 210,210, 0, 0, 260,280};
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.vowel_pause = 1;
tr->langopts.param[LOPT_DIERESES] = 1;
tr->langopts.param[LOPT_PREFIXES] = 1;
@@ -788,7 +782,7 @@ SetLengthMods(tr,3); // all equal
static const short stress_lengths_no[8] = {160,140, 200,200, 0,0, 220,210};
SetupTranslator(tr,stress_lengths_no,NULL);
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
SetLetterVowel(tr,'y');
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_HUNDRED_AND | NUM_ALLOW_SPACE | NUM_1900 + NUM_ORDINAL_DOT;
}
@@ -800,8 +794,8 @@ SetLengthMods(tr,3); // all equal
static const short stress_lengths_om[8] = {200,200, 200,200, 0,0, 200,200};
SetupTranslator(tr,stress_lengths_om,stress_amps_om);
tr->langopts.stress_rule = 2;
tr->langopts.stress_flags = 2 + NUM_SWAP_TENS | NUM_THOUS_SPACE | NUM_NOPAUSE; //??
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x16 + 0x80000;
}
break;
@@ -813,7 +807,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_pl,stress_amps_pl);
tr->charset_a0 = charsets[2]; // ISO-8859-2
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x6; // mark unstressed final syllables as diminished
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x8;
tr->langopts.max_initial_consonants = 7; // for example: wchrzczony :)
@@ -832,7 +826,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_pt,stress_amps_pt);
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 3; // stress on final syllable
tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable
tr->langopts.stress_flags = 0x6 | 0x10 | 0x20000;
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_DFRACTION_2 | NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_ROMAN;
SetLetterVowel(tr,'y');
@@ -848,7 +842,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_ro,stress_amps_ro);
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x100 + 0x6;
tr->charset_a0 = charsets[2]; // ISO-8859-2
@@ -863,7 +857,7 @@ SetLengthMods(tr,3); // all equal
case L('r','w'): // Kiryarwanda
{
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x16;
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
@@ -880,7 +874,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_sk,stress_amps_sk);
tr->charset_a0 = charsets[2]; // ISO-8859-2
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x16;
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
tr->langopts.max_initial_consonants = 5;
@@ -889,7 +883,7 @@ SetLengthMods(tr,3); // all equal
tr->langopts.numbers = NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ROMAN;
tr->langopts.numbers2 = 0x100;
tr->langopts.thousands_sep = 0; //no thousands separator
tr->langopts.thousands_sep = STRESSPOSN_1L; //no thousands separator
tr->langopts.decimal_sep = ',';
if(name2 == L('c','s'))
@@ -911,7 +905,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_sq,stress_amps_sq);
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x16 + 0x100;
SetLetterVowel(tr,'y');
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_DFRACTION_4;
@@ -926,7 +920,7 @@ SetLengthMods(tr,3); // all equal
static const short stress_lengths_sv[8] = {160,135, 220,220, 0,0, 250,280};
SetupTranslator(tr,stress_lengths_sv,stress_amps_sv);
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
SetLetterVowel(tr,'y');
tr->langopts.numbers = NUM_SINGLE_STRESS + NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_1900;
tr->langopts.accents = 1;
@@ -942,7 +936,7 @@ SetLengthMods(tr,3); // all equal
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.vowel_pause = 1;
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x6 | 0x10;
tr->langopts.numbers = NUM_AND_UNITS | NUM_HUNDRED_AND | NUM_SINGLE_AND | NUM_OMIT_1_HUNDRED;
@@ -961,7 +955,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_ta,stress_amps_ta);
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable
tr->langopts.break_numbers = 0x24a8; // 1000, 100,000 10,000,000
@@ -1045,7 +1039,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_vi,stress_amps_vi);
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.word_gap = 0x21; // length of a final vowel is less dependent on the next consonant, don't merge consonant with next word
// tr->langopts.vowel_pause = 4;
tr->letter_groups[0] = vowels_vi;
@@ -1064,7 +1058,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_zh,stress_amps_zh);
tr->langopts.stress_rule = 3; // stress on final syllable of a "word"
tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable of a "word"
tr->langopts.stress_flags = 2; // don't automatically set diminished stress (may be set in the intonation module)
tr->langopts.vowel_pause = 0;
tr->langopts.tone_language = 1; // Tone language, use CalcPitches_Tone() rather than CalcPitches()
+4 -2
View File
@@ -1448,7 +1448,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
return(flags);
}
if((flags & FLAG_ALT2_TRANS) && ((sylimit = tr->langopts.param[LOPT_COMBINE_WORDS]) > 0))
if(flags & FLAG_COMBINE)
{
char *p2;
int ok = 1;
@@ -1456,6 +1456,8 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
int c_word2;
char ph_buf[N_WORD_PHONEMES];
sylimit = tr->langopts.param[LOPT_COMBINE_WORDS];
// LANG=cs,sk
// combine a preposition with the following word
p2 = word;
@@ -1492,7 +1494,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
{
*p2 = '-'; // replace next space by hyphen
flags = TranslateWord(translator, word, next_pause, wtab); // translate the combined word
if(CountSyllables(p) > (sylimit & 0xf))
if((sylimit > 0) && (CountSyllables(p) > (sylimit & 0x1f)))
{
// revert to separate words
*p2 = ' ';
+10
View File
@@ -55,6 +55,7 @@
#define FLAG_DOUBLING 0x80000 // doubles the following consonant
#define FLAG_ALT_TRANS 0x100000 // language specific
#define FLAG_ALT2_TRANS 0x200000 // language specific
#define FLAG_COMBINE 0x400000 // combine with the next word
#define FLAG_MAX3 0x08000000 // limit to 3 repeats
#define FLAG_PAUSE1 0x10000000 // shorter prepause
@@ -296,6 +297,14 @@ extern const int param_defaults[N_SPEECH_PARAM];
#define LOPT_ALT 15
// stress_rule
#define STRESSPOSN_1L 0 // 1st syllable
#define STRESSPOSN_2L 1 // 2nd syllable
#define STRESSPOSN_2R 2 // penultimate
#define STRESSPOSN_1R 3 // final syllable
#define STRESSPOSN_3R 4 // antipenultimate
typedef struct {
// bits0-2 separate words with (1=pause_vshort, 2=pause_short, 3=pause, 4=pause_long 5=[?] phonemme)
// bit 3=don't use linking phoneme
@@ -408,6 +417,7 @@ typedef struct {
int listx; // compile *_listx after *list
const unsigned int *replace_chars; // characters to be substitutes
const char *ascii_language; // switch to this language for Latin characters
int max_lengthmod;
} LANGUAGE_OPTIONS;
+1
View File
@@ -30,6 +30,7 @@ typedef struct {
int speedf2;
int speedf3;
int speed_percent; // adjust the WPM speed by this percentage
int flutter;
int roughness;
int echo_delay;
+9
View File
@@ -104,6 +104,7 @@ enum {
V_MBROLA,
V_KLATT,
V_FAST,
V_SPEED,
// these need a phoneme table to have been specified
V_REPLACE,
@@ -150,6 +151,7 @@ static keywtab_t keyword_tab[] = {
{"consonants", V_CONSONANTS},
{"klatt", V_KLATT},
{"fast_test", V_FAST},
{"speed", V_SPEED},
// these just set a value in langopts.param[]
{"l_dieresis", 0x100+LOPT_DIERESES},
@@ -379,6 +381,7 @@ void VoiceReset(int tone_only)
voice->formant_factor = 256;
voice->speed_percent = 100;
voice->echo_delay = 0;
voice->echo_amp = 0;
voice->flutter = 64;
@@ -867,6 +870,10 @@ voice_t *LoadVoice(const char *vname, int control)
value = sscanf(p,"%d %d",&voice->consonant_amp, &voice->consonant_ampv);
break;
case V_SPEED:
sscanf(p,"%d",&voice->speed_percent);
break;
case V_MBROLA:
{
int srate = 16000;
@@ -911,6 +918,8 @@ voice_t *LoadVoice(const char *vname, int control)
new_translator = SelectTranslator(translator_name);
}
SetSpeed(1); // for speed_percent
for(ix=0; ix<N_PEAKS; ix++)
{
voice->freq2[ix] = voice->freq[ix];