[1.38.03]

Fix crash with SSML <say-as>.
Sada audio output now OK on big-endian processors.
Don't reduce the pause before doubles stop consonants (eg.Finnish "kk") as much at high speeds.
Language changes: pl (reduce length of stressed syllables, [i] closer, [f] stronger befiore [s]).


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@188 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2008-09-01 16:13:19 +00:00
parent 37ded768c9
commit b7a6f479ef
30 changed files with 673 additions and 200 deletions
+1 -1
View File
@@ -363,7 +363,7 @@ void OnOptions2(int event_id)
switch(event_id)
{
case MENU_PARAMS:
value = wxGetNumberFromUser(_T(""),_T(""),_T("Speed"),option_speed,80,320);
value = wxGetNumberFromUser(_T(""),_T(""),_T("Speed"),option_speed,80,390);
if(value > 0)
{
option_speed = value;
+3 -3
View File
@@ -608,7 +608,7 @@ void MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, FILE *f_mbrola)
if(name2 == '_')
{
// add a pause after this phoneme
pause = PauseLength(len_percent);
pause = PauseLength(len_percent,0);
name2 = 0;
}
@@ -653,7 +653,7 @@ void MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, FILE *f_mbrola)
else
len = DoSample(p->ph,phoneme_tab[phonPAUSE],2,0,-1);
len = (len * 1000)/samplerate; // convert to mS
len += PauseLength(p->prepause);
len += PauseLength(p->prepause,1);
break;
case phVSTOP:
@@ -704,7 +704,7 @@ void MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, FILE *f_mbrola)
if(pause)
{
sprintf(buf,"_ \t%d\n",PauseLength(pause));
sprintf(buf,"_ \t%d\n",PauseLength(pause,0));
strcat(mbr_buf,buf);
pause = 0;
}
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.38 22.Aug.08";
const char *version_string = "1.38.03 01.Sep.08";
const int version_phdata = 0x013800;
int option_device_number = -1;
+19 -13
View File
@@ -185,20 +185,26 @@ static void DoPitch(unsigned char *env, int pitch1, int pitch2)
int PauseLength(int pause)
{//=======================
int PauseLength(int pause, int control)
{//====================================
int len;
len = (pause * speed_factor1)/256;
if(control == 0)
len = (pause * speed_factor1)/256;
else
len = (pause * speed_factor2)/256;
if(len < 5) len = 5; // mS, limit the amount to which pauses can be shortened
return(len);
}
static void DoPause(int length)
{//============================
static void DoPause(int length, int control)
{//=========================================
// control = 1, less shortening at fast speeds
int len;
len = PauseLength(length);
len = PauseLength(length, control);
len = (len * samplerate) / 1000; // convert from mS to number of samples
@@ -617,7 +623,7 @@ static short vcolouring[N_VCOLOUR][5] = {
}
if(flags & 0x40)
DoPause(12); // add a short pause after the consonant
DoPause(12,0); // add a short pause after the consonant
if(flags & 16)
return(len);
@@ -1045,7 +1051,7 @@ static void DoEmbedded(int &embix, int sourceix)
{
if(soundicon_tab[value].length != 0)
{
DoPause(10); // ensure a break in the speech
DoPause(10,0); // ensure a break in the speech
wcmdq[wcmdq_tail][0] = WCMD_WAVE;
wcmdq[wcmdq_tail][1] = soundicon_tab[value].length;
wcmdq[wcmdq_tail][2] = (long)soundicon_tab[value].data + 44; // skip WAV header
@@ -1064,7 +1070,7 @@ static void DoEmbedded(int &embix, int sourceix)
break;
default:
DoPause(10); // ensure a break in the speech
DoPause(10,0); // ensure a break in the speech
wcmdq[wcmdq_tail][0] = WCMD_EMBEDDED;
wcmdq[wcmdq_tail][1] = command;
wcmdq[wcmdq_tail][2] = value;
@@ -1168,7 +1174,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
EndAmplitude();
if(p->prepause > 0)
DoPause(p->prepause);
DoPause(p->prepause,1);
if(option_phoneme_events && (p->type != phVOWEL))
{
@@ -1179,7 +1185,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
switch(p->type)
{
case phPAUSE:
DoPause(p->length);
DoPause(p->length,0);
break;
case phSTOP:
@@ -1229,7 +1235,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
DoSpect(p->ph,phoneme_tab[phonSCHWA],next->ph,1,p,0);
if(p->synthflags & SFLAG_LENGTHEN)
{
DoPause(20);
DoPause(20,0);
DoSpect(p->ph,phoneme_tab[phonSCHWA],next->ph,1,p,0);
}
}
@@ -1237,7 +1243,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
{
if(p->synthflags & SFLAG_LENGTHEN)
{
DoPause(50);
DoPause(50,0);
}
}
+2 -2
View File
@@ -260,7 +260,7 @@ extern const char *version_string;
extern const int version_phdata;
#define N_SOUNDICON_TAB 80 // total entries in soundicon_tab
#define N_SOUNDICON_SLOTS 4 // number of slots reserved for dynamic loading of autio files
#define N_SOUNDICON_SLOTS 4 // number of slots reserved for dynamic loading of audio files
extern int n_soundicon_tab;
extern SOUND_ICON soundicon_tab[N_SOUNDICON_TAB];
@@ -273,7 +273,7 @@ int MbrolaSynth(char *p_mbrola);
int DoSample(PHONEME_TAB *ph1, PHONEME_TAB *ph2, int which, int length_mod, int amp);
int DoSpect(PHONEME_TAB *this_ph, PHONEME_TAB *prev_ph, PHONEME_TAB *next_ph,
int which, PHONEME_LIST *plist, int modulation);
int PauseLength(int pause);
int PauseLength(int pause, int control);
int LookupPhonemeTable(const char *name);
void InitBreath(void);
+10 -4
View File
@@ -276,7 +276,7 @@ Translator *SelectTranslator(const char *name)
case L('f','i'): // Finnish
{
static const unsigned char stress_amps_fi[8] = {18,16, 22,22, 20,22, 22,22 };
static const short stress_lengths_fi[8] = {150,170, 200,200, 0,0, 210,250};
static const short stress_lengths_fi[8] = {150,180, 200,200, 0,0, 210,250};
tr = new Translator();
SetupTranslator(tr,stress_lengths_fi,stress_amps_fi);
@@ -284,7 +284,7 @@ Translator *SelectTranslator(const char *name)
tr->langopts.stress_rule = 0;
tr->langopts.stress_flags = 0x56; // move secondary stress from light to a following heavy syllable
tr->langopts.param[LOPT_IT_DOUBLING] = 1;
tr->langopts.long_stop = 140;
tr->langopts.long_stop = 130;
tr->langopts.numbers = 0x1809;
SetLetterVowel(tr,'y');
@@ -568,8 +568,8 @@ SetLengthMods(tr,3); // all equal
case L('p','l'): // Polish
{
static const short stress_lengths_pl[8] = {160, 180, 175, 175, 0, 0, 260, 290};
static const unsigned char stress_amps_pl[8] = {17,14, 19,19, 20,24, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
static const short stress_lengths_pl[8] = {160, 190, 175, 175, 0, 0, 200, 210};
static const unsigned char stress_amps_pl[8] = {17,13, 19,19, 20,24, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
tr = new Translator();
SetupTranslator(tr,stress_lengths_pl,stress_amps_pl);
@@ -671,6 +671,12 @@ SetLengthMods(tr,3); // all equal
}
break;
case L('s','q'): // Albanian
tr = new Translator();
SetLetterVowel(tr,'y');
break;
case L('s','v'): // Swedish
{
static const unsigned char stress_amps_sv[] = {16,16, 20,20, 20,24, 24,22 };
+2
View File
@@ -399,6 +399,8 @@ int IsDigit(unsigned int c)
int IsSpace(unsigned int c)
{//========================
if(c == 0)
return(0);
if(wcschr(chars_space,c))
return(1);
return(iswspace(c));
+19
View File
@@ -188,6 +188,25 @@ size_t wave_write(void* theHandler,
SHOW_TIME("wave_write > my_callback_is_output_enabled: no!");
return 0;
}
#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
{
// BIG-ENDIAN, swap the order of bytes in each sound sample
int c;
char *out_ptr;
char *out_end;
out_ptr = (char *)theMono16BitsWaveBuffer;
out_end = out_ptr + theSize;
while(out_ptr < out_end)
{
c = out_ptr[0];
out_ptr[0] = out_ptr[1];
out_ptr[1] = c;
out_ptr += 2;
}
}
#endif
num = write((int) theHandler, theMono16BitsWaveBuffer, theSize);
// Keep track of the total number of samples sent -- we use this in