Browse Source

Use the stress condition values in StressCondition.

master
Reece H. Dunn 8 years ago
parent
commit
b937d37e93
2 changed files with 5 additions and 7 deletions
  1. 2
    6
      src/libespeak-ng/synthdata.c
  2. 3
    1
      src/libespeak-ng/synthesize.h

+ 2
- 6
src/libespeak-ng/synthdata.c View File

@@ -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 {

+ 3
- 1
src/libespeak-ng/synthesize.h View File

@@ -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

Loading…
Cancel
Save