mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-12-04 07:48:47 +00:00
Use the stress condition values in StressCondition.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user