mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-26 13:09:39 +00:00
[1.46.37]
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-fd96e6ae7743
This commit is contained in:
+11
-8
@@ -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;
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+1
-3
@@ -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)
|
||||
{
|
||||
|
||||
+19
-19
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user