[1.31.06]

espeakEVENT_PHONEME, fix audio position of vowel when it follows a voiced consonant.
Ensure enough space in the event list when espeak_Initialize() is called with a small buffer size.
Tone languages: set the final stressed syllable to stress=7 so that it can be longer.
lang=zh: adjust vowels


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@136 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2008-02-05 17:03:06 +00:00
parent 703da28454
commit e5ada07055
11 changed files with 48 additions and 25 deletions
+2 -2
View File
@@ -1880,14 +1880,14 @@ void Translator::MatchRule(char *word[], const char *group, char *rule, MatchRec
case RULE_DIGIT:
if(IsDigit(letter_w))
{
match.points += (21-distance_right);
match.points += (20-distance_right);
post_ptr += letter_xbytes;
}
else
if(langopts.tone_numbers)
{
// also match if there is no digit
match.points += (21-distance_right);
match.points += (20-distance_right);
post_ptr--;
}
else
+11 -3
View File
@@ -759,8 +759,14 @@ void Translator::CalcPitches_Tone(int clause_tone)
{
if((p->type == phVOWEL) && (p->tone >= 4))
{
final_stressed = ix;
count_stressed++;
if(count_stressed == 0)
final_stressed = ix;
if(p->tone >= 4)
{
final_stressed = ix;
count_stressed++;
}
}
}
@@ -769,7 +775,6 @@ void Translator::CalcPitches_Tone(int clause_tone)
{
// LANG=vi
p = &phoneme_list[final_stressed];
p->tone = 7;
if(p->tone_ph == 0)
p->tone_ph = LookupPh("7"); // change tone 1 to falling tone at end of clause
}
@@ -889,6 +894,9 @@ void Translator::CalcPitches_Tone(int clause_tone)
p->pitch2 = pitch_adjust + phoneme_tab[tone_ph]->end_type;
}
}
phoneme_list[final_stressed].tone = 7;
} // end of Translator::CalcPitches_Tone
+3 -2
View File
@@ -698,8 +698,9 @@ ENTER("espeak_Initialize");
if((out_start = outbuf) == NULL)
return(EE_INTERNAL_ERROR);
// allocate space for event list. Allow 200 events per second
n_event_list = (buf_length*200)/1000;
// allocate space for event list. Allow 200 events per second.
// Add a constant to allow for very small buf_length
n_event_list = (buf_length*200)/1000 + 20;
if((event_list = (espeak_EVENT *)realloc(event_list,sizeof(espeak_EVENT) * n_event_list)) == NULL)
return(EE_INTERNAL_ERROR);
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.31.05 04.Feb.08";
const char *version_string = "1.31.06 05.Feb.08";
const int version_phdata = 0x013105;
int option_device_number = -1;
+12 -4
View File
@@ -1097,6 +1097,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
unsigned char *amp_env;
PHONEME_TAB *ph;
PHONEME_TAB *prev_ph;
static int sourceix=0;
#ifdef TEST_MBROLA
if(mbrola_name[0] != 0)
@@ -1140,15 +1141,16 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
if(p->newword)
{
last_frame = NULL;
sourceix = (p->sourceix & 0x7ff) + clause_start_char;
if(p->newword & 4)
DoMarker(espeakEVENT_SENTENCE, (p->sourceix & 0x7ff) + clause_start_char, 0, count_sentences); // start of sentence
DoMarker(espeakEVENT_SENTENCE, sourceix, 0, count_sentences); // start of sentence
// if(p->newword & 2)
// DoMarker(espeakEVENT_END, count_characters, 0, count_sentences); // end of clause
if(p->newword & 1)
DoMarker(espeakEVENT_WORD, (p->sourceix & 0x7ff) + clause_start_char, p->sourceix >> 11, clause_start_word + word_count++);
DoMarker(espeakEVENT_WORD, sourceix, p->sourceix >> 11, clause_start_word + word_count++);
}
EndAmplitude();
@@ -1156,9 +1158,10 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
if(p->prepause > 0)
DoPause(p->prepause);
if(option_phoneme_events)
if(option_phoneme_events && (p->type != phVOWEL))
{
DoMarker(espeakEVENT_PHONEME, (p->sourceix & 0x7ff) + clause_start_char, 0, p->ph->mnemonic);
// Note, for vowels, do the phoneme event after the vowel-start
DoMarker(espeakEVENT_PHONEME, sourceix, 0, p->ph->mnemonic);
}
switch(p->type)
@@ -1398,6 +1401,11 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
DoSpect(ph,prev->ph,next->ph,1,p,modulation);
}
if(option_phoneme_events)
{
DoMarker(espeakEVENT_PHONEME, sourceix, 0, p->ph->mnemonic);
}
DoSpect(p->ph,prev->ph,next->ph,2,p,modulation);
memset(vowel_transition,0,sizeof(vowel_transition));
+1 -1
View File
@@ -718,7 +718,7 @@ SetLengthMods(tr,3); // all equal
case L('z','h'):
case L_zhy:
{
static const short stress_lengths_zh[8] = {230,150, 230,230, 230,0, 230,250};
static const short stress_lengths_zh[8] = {230,150, 230,230, 230,0, 230,300};
static const unsigned char stress_amps_zh[] = {22,16, 22,22, 22,22, 22,22 };
tr = new Translator;