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



if (plist3->sourceix != 0) { if (plist3->sourceix != 0) {
phlist[ix].sourceix = plist3->sourceix; 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) { if (start_sentence) {
phlist[ix].newword = 5; // start of sentence + start of word
phlist[ix].newword |= PHLIST_START_OF_SENTENCE;
start_sentence = false; start_sentence = false;
} }
} else } else
ix++; ix++;
} }
} }
phlist[ix].newword = 2; // end of clause
phlist[ix].newword = PHLIST_END_OF_CLAUSE;


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

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

if (p2->ph->code == phonPAUSE_CLAUSE) if (p2->ph->code == phonPAUSE_CLAUSE)
end_of_clause = 2; 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; end_of_clause = 2;


// calc length modifier // calc length modifier

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

if (p->synthflags & SFLAG_EMBEDDED) if (p->synthflags & SFLAG_EMBEDDED)
DoEmbedded(&embedded_ix, p->sourceix); 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); 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++); 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); name = GetMbrName(p, ph, ph_prev, ph_next, &name2, &len_percent, &control);

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



sourceix = (p->sourceix & 0x7ff) + clause_start_char; 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 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) 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

unsigned char tone_ph; // tone phoneme to use with this vowel unsigned char tone_ph; // tone phoneme to use with this vowel
} PHONEME_LIST2; } PHONEME_LIST2;


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

typedef struct { typedef struct {
// The first section is a copy of PHONEME_LIST2 // The first section is a copy of PHONEME_LIST2
unsigned short synthflags; unsigned short synthflags;
unsigned char prepause; unsigned char prepause;
unsigned char postpause; unsigned char postpause;
unsigned char amp; 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 pitch1;
unsigned char pitch2; unsigned char pitch2;
unsigned char std_length; unsigned char std_length;

Loading…
Cancel
Save