Fixes for different sample rates. Fix bug in 1.46.36 where pause at end of a sentence was missing. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@303 d46cf337-b52f-0410-862d-fd96e6ae7743master
@@ -377,7 +377,7 @@ S s; S; t t; tS ts tS; | |||
ts; v w x z Z Z; | |||
Dictionary pt_dict 2013-02-19 | |||
Dictionary pt_dict 2013-02-20 | |||
& &/ &U~ &~ @ @- a A | |||
aI aU e E eI EI eU EU |
@@ -421,7 +421,7 @@ l/l_ [l] base | |||
[l/] fr | |||
l/l_@ [l/3] base | |||
[l/] fr | |||
l/l@ [L¸j] base | |||
l/l@ [h6s] base | |||
[l#] base | |||
[l] fr | |||
[l/2] fr | |||
@@ -455,7 +455,7 @@ l/L2_oL [l/2] base | |||
l/L2_uL [l/2] base | |||
l/l_3 [l/] de | |||
l/l_4 [ll] sq | |||
l/la [L¸j] base | |||
l/la [h6s] base | |||
[l#] base | |||
[l] fr | |||
[l/2] fr | |||
@@ -463,7 +463,7 @@ l/la [L | |||
[K] tn | |||
l/l_a [l/3] base | |||
[l/] fr | |||
l/le [L¸j] base | |||
l/le [h6s] base | |||
[l#] base | |||
[l] fr | |||
[l/2] fr | |||
@@ -475,7 +475,7 @@ l/L_eL_af [&] af | |||
[&:] af | |||
l/l_front [L] sq | |||
l/l_front_ [l/4] sq | |||
l/li [L¸j] base | |||
l/li [h6s] base | |||
[l#] base | |||
[l] fr | |||
[l/2] fr | |||
@@ -489,7 +489,7 @@ ll/ll [L] base | |||
ll/_ll [L] base | |||
l/l_long [l] base | |||
[l] fr | |||
l/lo [L¸j] base | |||
l/lo [h6s] base | |||
[l#] base | |||
[l/2] fr | |||
[K] nso | |||
@@ -500,7 +500,7 @@ l^/l_rfx [l.] base | |||
[l;] lt | |||
[l] ru | |||
[l^] ru | |||
l/lu [L¸j] base | |||
l/lu [h6s] base | |||
[l#] base | |||
[l] fr | |||
[l/2] fr | |||
@@ -2484,52 +2484,52 @@ vwl_en_us/oor [O:] en-us | |||
vwl_en_us/or [o@] en-us | |||
[O:] en-sc | |||
vwl_en_us/ur [U@] en-us | |||
vwl_fr/@2r [L¸j] fr | |||
vwl_fr/a2r [L¸j] fr | |||
vwl_fr/aa2r [L¸j] fr | |||
vwl_fr/@2r [] fr | |||
vwl_fr/a2r [] fr | |||
vwl_fr/aa2r [] fr | |||
vwl_fr/br [r/2] fr | |||
vwl_fr/e2r [L¸j] fr | |||
vwl_fr/e_2r [L¸j] fr | |||
vwl_fr/ee2r [L¸j] fr | |||
vwl_fr/i2r [L¸j] fr | |||
vwl_fr/e2r [] fr | |||
vwl_fr/e_2r [] fr | |||
vwl_fr/ee2r [] fr | |||
vwl_fr/i2r [] fr | |||
vwl_fr/j [j/] fr | |||
vwl_fr/lo [l] fr | |||
vwl_fr/o2r [L¸j] fr | |||
vwl_fr/oo2r [L¸j] fr | |||
vwl_fr/o2r [] fr | |||
vwl_fr/oo2r [] fr | |||
vwl_fr/r [r] fr | |||
[r/2] fr | |||
vwl_fr/r_ [r/] fr | |||
vwl_fr/r_@ [r/] fr | |||
vwl_fr/r@ [L¸j] fr | |||
vwl_fr/r@ [] fr | |||
vwl_fr/@R [x] pt-pt | |||
vwl_fr/r@2 [L¸j] fr | |||
vwl_fr/r@2 [] fr | |||
vwl_fr/@R2 [R] fr-ca | |||
vwl_fr/ra [L¸j] fr | |||
vwl_fr/ra [] fr | |||
vwl_fr/r_a [r/] fr | |||
vwl_fr/raa [L¸j] fr | |||
vwl_fr/re [L¸j] fr | |||
vwl_fr/raa [] fr | |||
vwl_fr/re [] fr | |||
vwl_fr/r_e [r/] fr | |||
vwl_fr/re2 [L¸j] fr | |||
vwl_fr/ree [L¸j] fr | |||
vwl_fr/ri [L¸j] fr | |||
vwl_fr/re2 [] fr | |||
vwl_fr/ree [] fr | |||
vwl_fr/ri [] fr | |||
vwl_fr/r_i [r/] fr | |||
vwl_fr/rj [L¸j] fr | |||
vwl_fr/rj [] fr | |||
vwl_fr/r_n [r/] fr | |||
vwl_fr/ro [L¸j] fr | |||
vwl_fr/ro [] fr | |||
vwl_fr/r_o [r/] fr | |||
vwl_fr/roo [L¸j] fr | |||
vwl_fr/roo [] fr | |||
vwl_fr/rr [r/] fr | |||
vwl_fr/ru [L¸j] fr | |||
vwl_fr/ru [] fr | |||
vwl_fr/r_u [r/] fr | |||
vwl_fr/rw [L¸j] fr | |||
vwl_fr/ry [L¸j] fr | |||
vwl_fr/rw [] fr | |||
vwl_fr/ry [] fr | |||
vwl_fr/r_y [r/] fr | |||
vwl_fr/tr [r/2] fr | |||
vwl_fr/trr [r/] fr | |||
vwl_fr/u2r [L¸j] fr | |||
vwl_fr/u2r [] fr | |||
vwl_fr/wa [w] fr | |||
[w/] fr | |||
vwl_fr/y2r [L¸j] fr | |||
vwl_fr/y2r [] fr | |||
vwl_hi/l-voc [l-] base | |||
[l] lt | |||
[l-] sk |
@@ -39,7 +39,7 @@ phoneme &~ | |||
vowel starttype #@ endtype #@ | |||
ipa ɐU+0303 | |||
length 180 | |||
IF thisPh(isStressed) THEN | |||
IF thisPh(isFinalVowel) THEN | |||
FMT(vnasal/W_n) | |||
ELSE | |||
FMT(vnasal/a#_n) |
@@ -104,7 +104,7 @@ static unsigned char pause_factor_350[] = { | |||
15,15,15,15,15}; // 370 | |||
// wav_factor adjustments for speeds 350 to 450 | |||
// Use this to calibrate speed for wpm 350-450 | |||
// Use this to calibrate speed for wpm 350-450 | |||
static unsigned char wav_factor_350[] = { | |||
120, 121, 120, 119, 119, // 350 | |||
118, 118, 117, 116, 116, // 355 | |||
@@ -275,6 +275,9 @@ void SetSpeed(int control) | |||
speed.min_sample_len = 420 - (wpm - 440); | |||
} | |||
// adjust for different sample rates | |||
speed.min_sample_len = (speed.min_sample_len * samplerate_native) / 22050; | |||
speed.pause_factor = (256 * s1)/115; // full speed adjustment, used for pause length | |||
speed.clause_pause_factor = 0; | |||
@@ -463,7 +466,7 @@ void SetAmplitude(int amp) | |||
if((amp >= 0) && (amp <= 20)) | |||
{ | |||
option_amplitude = (amplitude_factor[amp] * 480)/256; | |||
option_amplitude = (amplitude_factor[amp] * 480)/256; | |||
} | |||
} | |||
#endif | |||
@@ -606,7 +609,7 @@ void CalcLengths(Translator *tr) | |||
case phPAUSE: | |||
last_pitch = 0; | |||
break; | |||
case phSTOP: | |||
last_pitch = 0; | |||
if(prev->type == phFRICATIVE) | |||
@@ -710,7 +713,7 @@ void CalcLengths(Translator *tr) | |||
p->amp = tr->stress_amps[0]; // unless changed later | |||
p->length = 256; // TEMPORARY | |||
min_drop = 0; | |||
if(p->newword) | |||
{ | |||
if(prev->type==phLIQUID) | |||
@@ -733,12 +736,12 @@ void CalcLengths(Translator *tr) | |||
if((prev->type==phVOWEL) || (prev->type == phLIQUID)) | |||
{ | |||
p->length = prev->length; | |||
if(p->type == phLIQUID) | |||
{ | |||
p->length = speed1; | |||
} | |||
if(next->type == phVSTOP) | |||
{ | |||
p->length = (p->length * 160)/100; | |||
@@ -963,11 +966,11 @@ if(p->type != phVOWEL) | |||
next->synthflags &= ~SFLAG_SEQCONTINUE; | |||
if(next->type == phNASAL && next2->type != phVOWEL) | |||
next->synthflags |= SFLAG_SEQCONTINUE; | |||
if(next->type == phLIQUID) | |||
{ | |||
next->synthflags |= SFLAG_SEQCONTINUE; | |||
if(next2->type == phVOWEL) | |||
{ | |||
next->synthflags &= ~SFLAG_SEQCONTINUE; |
@@ -35,7 +35,7 @@ | |||
#include "translate.h" | |||
#include "wave.h" | |||
const char *version_string = "1.46.36 20.Feb.13"; | |||
const char *version_string = "1.46.37 20.Feb.13"; | |||
const int version_phdata = 0x014636; | |||
int option_device_number = -1; |
@@ -1377,7 +1377,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume) | |||
DoPause(0,0); // isolate from the previous clause | |||
} | |||
while(ix < (*n_ph)) | |||
while((ix < (*n_ph)) && (ix < N_PHONEME_LIST-2)) | |||
{ | |||
p = &phoneme_list[ix]; | |||
@@ -1395,8 +1395,6 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume) | |||
prev = &phoneme_list[ix-1]; | |||
next = &phoneme_list[ix+1]; | |||
next2 = &phoneme_list[ix+2]; | |||
if(next2->ph == NULL) | |||
break; | |||
if(p->synthflags & SFLAG_EMBEDDED) | |||
{ |
@@ -409,7 +409,7 @@ void VoiceReset(int tone_only) | |||
voice->voicing = 64; | |||
voice->consonant_amp = 100; | |||
voice->consonant_ampv = 100; | |||
voice->samplerate = 22050; | |||
voice->samplerate = samplerate_native; | |||
memset(voice->klattv,0,sizeof(voice->klattv)); | |||
speed.fast_settings[0] = 450; | |||
@@ -673,24 +673,24 @@ voice_t *LoadVoice(const char *vname, int control) | |||
if(tone_only) | |||
break; | |||
priority = DEFAULT_LANGUAGE_PRIORITY; | |||
language_name[0] = 0; | |||
sscanf(p,"%s %d",language_name,&priority); | |||
if(strcmp(language_name,"variant") == 0) | |||
break; | |||
len = strlen(language_name) + 2; | |||
// check for space in languages[] | |||
if(len < (sizeof(voice_languages)-langix-1)) | |||
{ | |||
voice_languages[langix] = priority; | |||
strcpy(&voice_languages[langix+1],language_name); | |||
langix += len; | |||
} | |||
// only act on the first language line | |||
if(language_set == 0) | |||
{ | |||
@@ -700,10 +700,10 @@ voice_t *LoadVoice(const char *vname, int control) | |||
strcpy(new_dictionary,language_type); | |||
strcpy(phonemes_name,language_type); | |||
SelectPhonemeTableName(phonemes_name); | |||
if(new_translator != NULL) | |||
DeleteTranslator(new_translator); | |||
new_translator = SelectTranslator(translator_name); | |||
langopts = &new_translator->langopts; | |||
} | |||
@@ -1058,10 +1058,10 @@ static char *ExtractVoiceVariantName(char *vname, int variant_num, int add_dir) | |||
{ | |||
// voice variant name, not number | |||
sprintf(variant_name, "%s%s", variant_prefix, p); | |||
} | |||
} | |||
} | |||
} | |||
if(variant_num > 0) | |||
{ | |||
if(variant_num < 10) | |||
@@ -1420,13 +1420,13 @@ char const *SelectVoice(espeak_VOICE *voice_select, int *found) | |||
{ | |||
// no language is specified. Get language from the named voice | |||
static char buf[60]; | |||
if(voice_select2.name == NULL) | |||
{ | |||
if((voice_select2.name = voice_select2.identifier) == NULL) | |||
voice_select2.name = "default"; | |||
} | |||
strncpy0(buf,voice_select2.name,sizeof(buf)); | |||
variant_name = ExtractVoiceVariantName(buf,0,0); | |||
@@ -1491,7 +1491,7 @@ char const *SelectVoice(espeak_VOICE *voice_select, int *found) | |||
} | |||
if(skip==0) | |||
{ | |||
voices2[ix2++] = vp; | |||
voices2[ix2++] = vp; | |||
} | |||
for(j=0; (j < vp->xx1) && (n_variants < N_VOICE_VARIANTS);) | |||
@@ -1578,10 +1578,10 @@ static void GetVoices(const char *path) | |||
} | |||
else | |||
{ | |||
// a regular line, add it to the voices list | |||
// a regular line, add it to the voices list | |||
if((f_voice = fopen(fname,"r")) == NULL) | |||
continue; | |||
// pass voice file name within the voices directory | |||
voice_data = ReadVoiceFile(f_voice, fname+len_path_voices, &buf[20]); | |||
fclose(f_voice); | |||
@@ -1616,10 +1616,10 @@ static void GetVoices(const char *path) | |||
else | |||
if(ftype > 0) | |||
{ | |||
// a regular line, add it to the voices list | |||
// a regular line, add it to the voices list | |||
if((f_voice = fopen(fname,"r")) == NULL) | |||
continue; | |||
// pass voice file name within the voices directory | |||
voice_data = ReadVoiceFile(f_voice, fname+len_path_voices, FindFileData.cFileName); | |||
fclose(f_voice); | |||
@@ -1656,10 +1656,10 @@ static void GetVoices(const char *path) | |||
else | |||
if(ftype > 0) | |||
{ | |||
// a regular line, add it to the voices list | |||
// a regular line, add it to the voices list | |||
if((f_voice = fopen(fname,"r")) == NULL) | |||
continue; | |||
// pass voice file name within the voices directory | |||
voice_data = ReadVoiceFile(f_voice, fname+len_path_voices, ent->d_name); | |||
fclose(f_voice); |