[1.36.01]

Bug fixes.

git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@166 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2008-03-12 01:37:17 +00:00
parent 2524376f0f
commit ed8d0c5bfc
9 changed files with 50 additions and 34 deletions
+1 -1
View File
@@ -66,7 +66,7 @@
#define M_IMPLOSIVE M_HOOK
typedef struct {
char *name;
const char *name;
int flags;
} ACCENTS;
+2 -2
View File
@@ -54,7 +54,7 @@ int ungot_char2 = 0;
char *p_textinput;
wchar_t *p_wchar_input;
int ungot_char;
char *ungot_word = NULL;
const char *ungot_word = NULL;
int end_of_input;
int ignore_text=0; // set during <sub> ... </sub> to ignore text which has been replaced by an alias
@@ -528,7 +528,7 @@ const char *Translator::LookupCharName(int c)
char single_letter[24];
char phonemes[60];
char phonemes2[60];
char *lang_name = NULL;
const char *lang_name = NULL;
char *string;
static char buf[60];
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.36 09.Mar.08";
const char *version_string = "1.36.01 11.Mar.08";
const int version_phdata = 0x013400;
int option_device_number = -1;
+12 -2
View File
@@ -1093,6 +1093,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
int stress;
int modulation;
int pre_voiced;
int free_min;
unsigned char *pitch_env=NULL;
unsigned char *amp_env;
PHONEME_TAB *ph;
@@ -1125,11 +1126,20 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
while(ix < (*n_ph))
{
if(WcmdqFree() <= MIN_WCMDQ)
p = &phoneme_list[ix];
if(p->type == phPAUSE)
free_min = 5;
else
if(p->type != phVOWEL)
free_min = 10; // we need less Q space for non-vowels, and we need to generate phonemes after a vowel so that the pitch_length is filled in
else
free_min = MIN_WCMDQ; // 22
if(WcmdqFree() <= free_min)
return(1); // wait
prev = &phoneme_list[ix-1];
p = &phoneme_list[ix];
next = &phoneme_list[ix+1];
next2 = &phoneme_list[ix+2];
+1 -1
View File
@@ -189,7 +189,7 @@ extern unsigned char pitch_adjust_tab[MAX_PITCH_VALUE+1];
#define N_WCMDQ 160
#define MIN_WCMDQ 20 // need this many free entries before adding new phoneme
#define MIN_WCMDQ 22 // need this many free entries before adding new phoneme
extern long wcmdq[N_WCMDQ][4];
extern int wcmdq_head;
+21 -18
View File
@@ -864,7 +864,7 @@ if((wmark > 0) && (wmark < 8))
if((word_length == 1) && IsAlpha(wc))
{
posn = 0;
while(*wordx != ' ')
while((*wordx != ' ') && (*wordx != 0))
{
wordx += TranslateLetter(wordx, phonemes, 4, word_length);
posn++;
@@ -1439,8 +1439,9 @@ int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int ne
}
else
{
int c2;
ix = 0;
while((word_copy[ix] = word[ix]) != ' ') ix++;
while(((c2 = word_copy[ix] = word[ix]) != ' ') && (c2 != 0)) ix++;
word_copy_len = ix;
flags = translator->TranslateWord(word, next_pause, wtab);
@@ -1471,22 +1472,25 @@ int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int ne
ok =0;
}
if(sylimit & 0x100)
if(ok != 0)
{
// only if the second word has $alt attribute
strcpy(ph_buf,word_phonemes);
flags2 = translator->TranslateWord(p2+1, 0, wtab+1);
if((flags2 & FLAG_ALT_TRANS) == 0)
if(sylimit & 0x100)
{
ok = 0;
strcpy(word_phonemes,ph_buf);
// only if the second word has $alt attribute
strcpy(ph_buf,word_phonemes);
flags2 = translator->TranslateWord(p2+1, 0, wtab+1);
if((flags2 & FLAG_ALT_TRANS) == 0)
{
ok = 0;
strcpy(word_phonemes,ph_buf);
}
}
if((sylimit & 0x200) && ((wtab+1)->flags & FLAG_LAST_WORD))
{
// not if the next word is end-of-sentence
ok = 0;
}
}
if((sylimit & 0x200) && ((wtab+1)->flags & FLAG_LAST_WORD))
{
// not if the next word is end-of-sentence
ok = 0;
}
if(ok)
@@ -1995,10 +1999,9 @@ void *Translator::TranslateClause(FILE *f_text, const void *vp_input, int *tone_
}
}
memset(&ph_list2[0],0,sizeof(ph_list2[0]));
ph_list2[0].phcode = phonPAUSE_SHORT;
ph_list2[0].stress = 0;
ph_list2[0].tone_number = 0;
ph_list2[0].sourceix = 0;
n_ph_list2 = 1;
prev_last_stress = 0;
prepause_timeout = 0;