diff --git a/src/libespeak-ng/synthdata.c b/src/libespeak-ng/synthdata.c index fb54e27a..ad76d0e9 100644 --- a/src/libespeak-ng/synthdata.c +++ b/src/libespeak-ng/synthdata.c @@ -443,9 +443,6 @@ static void InvalidInstn(PHONEME_TAB *ph, int instn) static bool StressCondition(Translator *tr, PHONEME_LIST *plist, int condition, int control) { - // condition: - // 0 if diminished, 1 if unstressed, 2 if not stressed, 3 if stressed, 4 if max stress - int stress_level; PHONEME_LIST *pl; static int condition_level[4] = { 1, 2, 4, 15 }; @@ -474,11 +471,10 @@ static bool StressCondition(Translator *tr, PHONEME_LIST *plist, int condition, } } - if (condition == 4) + if (condition == isMaxStress) return stress_level >= pl->wordstress; - if (condition == 3) { - // if stressed + if (condition == isStressed) { if (stress_level > 3) return true; } else { diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h index 9052828f..e28e3d6d 100644 --- a/src/libespeak-ng/synthesize.h +++ b/src/libespeak-ng/synthesize.h @@ -317,12 +317,14 @@ typedef struct { #define CONDITION_IS_PHFLAG_SET 0x40 #define CONDITION_IS_OTHER 0x80 -// other conditions +// other conditions (stress) #define isDiminished 0 #define isUnstressed 1 #define isNotStressed 2 #define isStressed 3 #define isMaxStress 4 + +// other conditions #define isBreak 5 // pause phoneme or (stop/vstop/vfric not followed by vowel or (liquid in same word)) #define isWordStart 6 #define isWordEnd 8