Browse Source

Add constants for use with PHONEME_LIST.newword.

master
Reece H. Dunn 7 years ago
parent
commit
8e13f7147c

+ 3
- 3
src/libespeak-ng/phonemelist.c View File

@@ -496,10 +496,10 @@ void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n

if (plist3->sourceix != 0) {
phlist[ix].sourceix = plist3->sourceix;
phlist[ix].newword = 1; // this phoneme is the start of a word
phlist[ix].newword = PHLIST_START_OF_WORD;

if (start_sentence) {
phlist[ix].newword = 5; // start of sentence + start of word
phlist[ix].newword |= PHLIST_START_OF_SENTENCE;
start_sentence = false;
}
} else
@@ -523,7 +523,7 @@ void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n
ix++;
}
}
phlist[ix].newword = 2; // end of clause
phlist[ix].newword = PHLIST_END_OF_CLAUSE;

phlist[ix].phcode = phonPAUSE;
phlist[ix].type = phPAUSE; // terminate with 2 Pause phonemes

+ 1
- 1
src/libespeak-ng/setlengths.c View File

@@ -658,7 +658,7 @@ void CalcLengths(Translator *tr)
if (p2->ph->code == phonPAUSE_CLAUSE)
end_of_clause = 2;

if ((p2->newword & 2) && (more_syllables == 0))
if ((p2->newword & PHLIST_END_OF_CLAUSE) && (more_syllables == 0))
end_of_clause = 2;

// calc length modifier

+ 2
- 2
src/libespeak-ng/synth_mbrola.c View File

@@ -361,9 +361,9 @@ int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, bool resume, FILE *f_mb
if (p->synthflags & SFLAG_EMBEDDED)
DoEmbedded(&embedded_ix, p->sourceix);

if (p->newword & 4)
if (p->newword & PHLIST_START_OF_SENTENCE)
DoMarker(espeakEVENT_SENTENCE, (p->sourceix & 0x7ff) + clause_start_char, 0, count_sentences);
if (p->newword & 1)
if (p->newword & PHLIST_START_OF_SENTENCE)
DoMarker(espeakEVENT_WORD, (p->sourceix & 0x7ff) + clause_start_char, p->sourceix >> 11, clause_start_word + word_count++);

name = GetMbrName(p, ph, ph_prev, ph_next, &name2, &len_percent, &control);

+ 2
- 2
src/libespeak-ng/synthesize.c View File

@@ -1213,10 +1213,10 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, bool resume)

sourceix = (p->sourceix & 0x7ff) + clause_start_char;

if (p->newword & 4)
if (p->newword & PHLIST_START_OF_SENTENCE)
DoMarker(espeakEVENT_SENTENCE, sourceix, 0, count_sentences); // start of sentence

if (p->newword & 1)
if (p->newword & PHLIST_START_OF_WORD)
DoMarker(espeakEVENT_WORD, sourceix, p->sourceix >> 11, clause_start_word + word_count++); // NOTE, this count doesn't include multiple-word pronunciations in *_list. eg (of a)
}


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

@@ -187,6 +187,10 @@ typedef struct {
unsigned char tone_ph; // tone phoneme to use with this vowel
} PHONEME_LIST2;

#define PHLIST_START_OF_WORD 1
#define PHLIST_END_OF_CLAUSE 2
#define PHLIST_START_OF_SENTENCE 4

typedef struct {
// The first section is a copy of PHONEME_LIST2
unsigned short synthflags;
@@ -203,7 +207,7 @@ typedef struct {
unsigned char prepause;
unsigned char postpause;
unsigned char amp;
unsigned char newword; // bit 0=start of word, bit 1=end of clause, bit 2=start of sentence
unsigned char newword; // bit flags, see PHLIST_(START|END)_OF_*
unsigned char pitch1;
unsigned char pitch2;
unsigned char std_length;

Loading…
Cancel
Save