mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-10 16:21:29 +00:00
[1.39.39]
Windows SAPI5 installer: Remove the limit on the number of voices specified for inclusion in the Windows Registry. voices.cpp: Widen formant peaks F3 F4 F5. Reduce slightly the difference in amplitude between stressed and unstressed vowels. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@208 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
@@ -1223,6 +1223,12 @@ void Compile::VowelTransition(int which, unsigned int *trans)
|
||||
{
|
||||
len = 50 / 2; // defaults for transition into vowel
|
||||
rms = 25 / 2;
|
||||
|
||||
if(ph->type == phSTOP)
|
||||
{
|
||||
len = 42 / 2; // defaults for transition into vowel
|
||||
rms = 30 / 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(which==2)
|
||||
|
||||
+1
-1
@@ -684,7 +684,7 @@ int Translator::IsLetterGroup(char *word, int group, int pre)
|
||||
// match the word against a list of utf-8 strings
|
||||
char *p;
|
||||
char *w;
|
||||
int len;
|
||||
int len=0;
|
||||
|
||||
p = letterGroups[group];
|
||||
if(p == NULL)
|
||||
|
||||
+2
-2
@@ -278,9 +278,9 @@ void FormantDlg::ShowFrame(SpectSeq *spectseq, int frame, int pk, int field)
|
||||
}
|
||||
if(field & 4)
|
||||
{
|
||||
value.Printf(_T("%3d"),sf->peaks[ix].pkwidth);
|
||||
value.Printf(_T("%3d"),sf->peaks[ix].pkwidth/2);
|
||||
t_pkwidth[ix]->SetValue(value);
|
||||
value.Printf(_T("%3d"),sf->peaks[ix].pkright);
|
||||
value.Printf(_T("%3d"),sf->peaks[ix].pkright/2);
|
||||
t_pkright[ix]->SetValue(value);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1120,7 +1120,7 @@ void SetSynth_Klatt(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t *v
|
||||
}
|
||||
|
||||
{
|
||||
FILE *f;
|
||||
//FILE *f;
|
||||
//f=fopen("klatt_log","a");
|
||||
//fprintf(f,"len %4d (%3d %4d %4d) (%3d %4d %4d)\n",length,fr1->ffreq[1],fr1->ffreq[2],fr1->ffreq[3],fr2->ffreq[1],fr2->ffreq[2],fr2->ffreq[3]);
|
||||
//fclose(f);
|
||||
|
||||
+1
-1
@@ -483,7 +483,7 @@ void Translator::LookupAccentedLetter(unsigned int letter, char *ph_buf)
|
||||
if((langopts.accents & 1) || (accents_tab[accent1].flags & 1))
|
||||
sprintf(ph_buf,"%s%c%c%s", ph_accent1, phonPAUSE_VSHORT, phonSTRESS_P, ph_letter1);
|
||||
else
|
||||
sprintf(ph_buf,"%s%c%s%c", ph_letter1, phonPAUSE_VSHORT, ph_accent1, phonPAUSE_VSHORT);
|
||||
sprintf(ph_buf,"%c%s%c%s%c", phonSTRESS_2, ph_letter1, phonPAUSE_VSHORT, ph_accent1, phonPAUSE_VSHORT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ public:
|
||||
void ToggleMarker(int n);
|
||||
void ApplyVoiceMods();
|
||||
|
||||
void MakeWave(int peaks, PitchEnvelope &pitch, int amplitude, int duration);
|
||||
void MakeWaveF(int peaks, PitchEnvelope &pitch, int amplitude, int duration);
|
||||
void MakeHtab(int numh, int *htab, int pitch);
|
||||
double GetRms(int amp);
|
||||
void KlattDefaults();
|
||||
|
||||
@@ -831,12 +831,12 @@ void SpectDisplay::OnKey(wxKeyEvent& event)
|
||||
case WXK_F1:
|
||||
// make and play selected
|
||||
ReadDialogValues();
|
||||
sf->MakeWave(0,voicedlg->pitchenv,spectseq->amplitude,spectseq->duration);
|
||||
sf->MakeWaveF(0,voicedlg->pitchenv,spectseq->amplitude,spectseq->duration);
|
||||
break;
|
||||
case WXK_F3:
|
||||
// make and play selected
|
||||
ReadDialogValues();
|
||||
sf->MakeWave(1,voicedlg->pitchenv,spectseq->amplitude,spectseq->duration);
|
||||
sf->MakeWaveF(1,voicedlg->pitchenv,spectseq->amplitude,spectseq->duration);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
+11
-8
@@ -1056,7 +1056,7 @@ KlattInit();
|
||||
|
||||
if((start==end) || (total_length == 0))
|
||||
{
|
||||
sp1->MakeWave(0,voicedlg->pitchenv,amplitude,duration);
|
||||
sp1->MakeWaveF(0,voicedlg->pitchenv,amplitude,duration);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1071,7 +1071,7 @@ KlattInit();
|
||||
|
||||
// if((start==end) || (total_length == 0))
|
||||
// {
|
||||
// sp1->MakeWave(1, pitch, amplitude, duration);
|
||||
// sp1->MakeWaveF(1, pitch, amplitude, duration);
|
||||
// return;
|
||||
// }
|
||||
|
||||
@@ -1144,7 +1144,7 @@ void SpectFrame::MakeHtab(int numh, int *htab, int pitch)
|
||||
} // end of SpectFrame::MakeHtab
|
||||
|
||||
|
||||
void SpectFrame::MakeWave(int control, PitchEnvelope &pitche, int amplitude, int duration)
|
||||
void SpectFrame::MakeWaveF(int control, PitchEnvelope &pitche, int amplitude, int duration)
|
||||
{//======================================================================================
|
||||
// amplitude: percentage adjustment
|
||||
|
||||
@@ -1157,7 +1157,6 @@ void SpectFrame::MakeWave(int control, PitchEnvelope &pitche, int amplitude, int
|
||||
int ipitch;
|
||||
int pbase;
|
||||
char *fname_speech;
|
||||
// USHORT htab0[600];
|
||||
|
||||
KlattInit();
|
||||
SpeakNextClause(NULL,NULL,2); // stop speaking file
|
||||
@@ -1204,18 +1203,22 @@ KlattInit();
|
||||
else
|
||||
{
|
||||
#ifdef SPECT_EDITOR
|
||||
int maxh;
|
||||
USHORT htab0[600];
|
||||
|
||||
maxh = nx;
|
||||
if(maxh >= 600)
|
||||
maxh = 600-1;
|
||||
|
||||
for(ix=0; ix<=maxh; ix++)
|
||||
htab0[ix] = 0;
|
||||
SetSynthHtab(20,htab0,maxh,dx,spect,maxh,dx);
|
||||
MakeWaveFile();
|
||||
// SetSynthHtab(20,htab0,maxh,dx,spect,maxh,dx);
|
||||
SetSynthHtab(20,spect,maxh,dx,spect,maxh,dx);
|
||||
MakeWaveFile(0);
|
||||
SetSynthHtab(length,spect,maxh,dx,spect,maxh,dx);
|
||||
MakeWaveFile();
|
||||
MakeWaveFile(0);
|
||||
SetSynthHtab(30,spect,maxh,dx,htab0,maxh,dx);
|
||||
MakeWaveFile();
|
||||
MakeWaveFile(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.39.36 03.Dec.08";
|
||||
const char *version_string = "1.39.39 11.Dec.08";
|
||||
const int version_phdata = 0x013900;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ int n_soundicon_tab=N_SOUNDICON_SLOTS;
|
||||
SOUND_ICON soundicon_tab[N_SOUNDICON_TAB];
|
||||
|
||||
#define RMS_GLOTTAL1 35 // vowel before glottal stop
|
||||
#define RMS_START 28 // 14 - 30
|
||||
#define RMS_START 28 // 28
|
||||
|
||||
#define VOWEL_FRONT_LENGTH 50
|
||||
|
||||
|
||||
+17
-16
@@ -123,7 +123,7 @@ Translator *SelectTranslator(const char *name)
|
||||
int name2 = 0;
|
||||
Translator *tr;
|
||||
|
||||
static const unsigned char stress_amps_sk[8] = {17,17, 20,20, 20,24, 24,22 };
|
||||
static const unsigned char stress_amps_sk[8] = {17,17, 20,20, 20,22, 22,21 };
|
||||
static const short stress_lengths_sk[8] = {190,190, 210,210, 0,0, 210,210};
|
||||
|
||||
// convert name string into a word of up to 4 characters, for the switch()
|
||||
@@ -232,7 +232,7 @@ Translator *SelectTranslator(const char *name)
|
||||
case L_grc: // Ancient Greek
|
||||
{
|
||||
static const short stress_lengths_el[8] = {155, 180, 210, 210, 0, 0, 270, 300};
|
||||
static const unsigned char stress_amps_el[8] = {15,12, 20,20, 20,24, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
static const unsigned char stress_amps_el[8] = {15,12, 20,20, 20,22, 22,21 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
|
||||
// character codes offset by 0x380
|
||||
static const char el_vowels[] = {0x10,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x35,0x37,0x39,0x3f,0x45,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0};
|
||||
@@ -275,7 +275,7 @@ Translator *SelectTranslator(const char *name)
|
||||
case L('e','o'):
|
||||
{
|
||||
static const short stress_lengths_eo[8] = {145, 145, 230, 170, 0, 0, 360, 370};
|
||||
static const unsigned char stress_amps_eo[] = {16,14, 20,20, 20,24, 24,22 };
|
||||
static const unsigned char stress_amps_eo[] = {16,14, 20,20, 20,22, 22,21 };
|
||||
static const wchar_t eo_char_apostrophe[2] = {'l',0};
|
||||
|
||||
tr = new Translator();
|
||||
@@ -378,7 +378,7 @@ Translator *SelectTranslator(const char *name)
|
||||
case L('n','e'): // Nepali
|
||||
{
|
||||
static const short stress_lengths_hi[8] = {190, 190, 210, 210, 0, 0, 230, 250};
|
||||
static const unsigned char stress_amps_hi[8] = {17,14, 20,19, 20,24, 24,22 };
|
||||
static const unsigned char stress_amps_hi[8] = {17,14, 20,19, 20,22, 22,21 };
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_hi,stress_amps_hi);
|
||||
@@ -399,7 +399,7 @@ Translator *SelectTranslator(const char *name)
|
||||
case L('b','s'): // Bosnian
|
||||
case L('s','r'): // Serbian
|
||||
{
|
||||
static const unsigned char stress_amps_hr[8] = {17,17, 20,20, 20,24, 24,22 };
|
||||
static const unsigned char stress_amps_hr[8] = {17,17, 20,20, 20,22, 22,21 };
|
||||
static const short stress_lengths_hr[8] = {180,160, 200,200, 0,0, 220,230};
|
||||
static const short stress_lengths_sr[8] = {160,150, 200,200, 0,0, 250,260};
|
||||
|
||||
@@ -430,7 +430,7 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
case L('h','u'): // Hungarian
|
||||
{
|
||||
static const unsigned char stress_amps_hu[8] = {17,17, 19,19, 20,24, 24,22 };
|
||||
static const unsigned char stress_amps_hu[8] = {17,17, 19,19, 20,22, 22,21 };
|
||||
static const short stress_lengths_hu[8] = {185,195, 195,190, 0,0, 210,220};
|
||||
|
||||
tr = new Translator();
|
||||
@@ -467,6 +467,7 @@ SetLengthMods(tr,3); // all equal
|
||||
SetLetterBits(tr,LETTERGP_A,hy_vowels);
|
||||
SetLetterBits(tr,LETTERGP_C,hy_consonants);
|
||||
tr->langopts.max_initial_consonants = 6;
|
||||
tr->langopts.numbers = 0x409;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -567,7 +568,7 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('k','u'): // Kurdish
|
||||
{
|
||||
static const unsigned char stress_amps_ku[8] = {18,18, 20,20, 20,24, 24,22 };
|
||||
static const unsigned char stress_amps_ku[8] = {18,18, 20,20, 20,22, 22,21 };
|
||||
static const short stress_lengths_ku[8] = {180,180, 190,180, 0,0, 230,240};
|
||||
|
||||
tr = new Translator();
|
||||
@@ -597,8 +598,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('l','v'): // latvian
|
||||
{
|
||||
static const unsigned char stress_amps_lv[8] = {17,14, 20,20, 20,22, 22,22 };
|
||||
static const short stress_lengths_lv[8] = {180,140, 210,210, 0,0, 210,210};
|
||||
static const unsigned char stress_amps_lv[8] = {17,13, 20,20, 20,22, 22,21 };
|
||||
static const short stress_lengths_lv[8] = {180,130, 210,210, 0,0, 210,210};
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_lv,stress_amps_lv);
|
||||
|
||||
@@ -614,7 +615,7 @@ SetLengthMods(tr,3); // all equal
|
||||
{
|
||||
static wchar_t vowels_cyrillic[] = {0x440, // also include 'р' [R]
|
||||
0x430,0x435,0x438,0x439,0x43e,0x443,0x44b,0x44d,0x44e,0x44f,0x450,0x451,0x456,0x457,0x45d,0x45e,0};
|
||||
static const unsigned char stress_amps_mk[8] = {17,17, 20,20, 20,24, 24,22 };
|
||||
static const unsigned char stress_amps_mk[8] = {17,17, 20,20, 20,22, 22,21 };
|
||||
static const short stress_lengths_mk[8] = {180,160, 200,200, 0,0, 220,230};
|
||||
|
||||
tr = new Translator();
|
||||
@@ -672,7 +673,7 @@ SetLengthMods(tr,3); // all equal
|
||||
case L('p','l'): // Polish
|
||||
{
|
||||
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
|
||||
static const unsigned char stress_amps_pl[8] = {17,13, 19,19, 20,22, 22,21 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_pl,stress_amps_pl);
|
||||
@@ -692,7 +693,7 @@ SetLengthMods(tr,3); // all equal
|
||||
case L('p','t'): // Portuguese
|
||||
{
|
||||
static const short stress_lengths_pt[8] = {180, 125, 210, 210, 0, 0, 270, 295};
|
||||
static const unsigned char stress_amps_pt[8] = {16,13, 19,19, 20,24, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
static const unsigned char stress_amps_pt[8] = {16,13, 19,19, 20,22, 22,21 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_pt,stress_amps_pt);
|
||||
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
|
||||
@@ -709,7 +710,7 @@ SetLengthMods(tr,3); // all equal
|
||||
case L('r','o'): // Romanian
|
||||
{
|
||||
static const short stress_lengths_ro[8] = {170, 170, 180, 180, 0, 0, 240, 260};
|
||||
static const unsigned char stress_amps_ro[8] = {15,13, 18,18, 20,22, 22,22 };
|
||||
static const unsigned char stress_amps_ro[8] = {15,13, 18,18, 20,22, 22,21 };
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_ro,stress_amps_ro);
|
||||
@@ -789,7 +790,7 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('s','v'): // Swedish
|
||||
{
|
||||
static const unsigned char stress_amps_sv[] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static const unsigned char stress_amps_sv[] = {16,16, 20,20, 20,22, 22,21 };
|
||||
static const short stress_lengths_sv[8] = {160,135, 220,220, 0,0, 250,280};
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_sv,stress_amps_sv);
|
||||
@@ -805,7 +806,7 @@ SetLengthMods(tr,3); // all equal
|
||||
case L('s','w'): // Swahili
|
||||
{
|
||||
static const short stress_lengths_sw[8] = {160, 170, 200, 200, 0, 0, 320, 340};
|
||||
static const unsigned char stress_amps_sw[] = {16,12, 19,19, 20,24, 24,22 };
|
||||
static const unsigned char stress_amps_sw[] = {16,12, 19,19, 20,22, 22,21 };
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_sw,stress_amps_sw);
|
||||
@@ -878,7 +879,7 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('t','r'): // Turkish
|
||||
{
|
||||
static const unsigned char stress_amps_tr[8] = {18,18, 20,20, 20,24, 24,22 };
|
||||
static const unsigned char stress_amps_tr[8] = {18,18, 20,20, 20,22, 22,21 };
|
||||
static const short stress_lengths_tr[8] = {190,190, 190,190, 0,0, 250,270};
|
||||
|
||||
tr = new Translator();
|
||||
|
||||
+1
-1
@@ -412,7 +412,7 @@ int IsSpace(unsigned int c)
|
||||
Translator::Translator()
|
||||
{//=====================
|
||||
int ix;
|
||||
static const unsigned char stress_amps2[] = {17,17, 20,20, 20,24, 24,21 };
|
||||
static const unsigned char stress_amps2[] = {17,17, 20,20, 20,22, 22,20 };
|
||||
static const short stress_lengths2[8] = {182,140, 220,220, 220,240, 260,280};
|
||||
static const wchar_t empty_wstring[1] = {0};
|
||||
static const wchar_t punct_in_word[2] = {'\'', 0}; // allow hyphen within words
|
||||
|
||||
+5
-2
@@ -362,6 +362,9 @@ void VoiceReset(int tone_only)
|
||||
// Set voice to the default values
|
||||
|
||||
int pk;
|
||||
static unsigned char default_heights[N_PEAKS] = {255,255,240,240,220,220,255,255,255};
|
||||
static unsigned char default_widths[N_PEAKS] = {128,128,128,160,171,171,128,128,128};
|
||||
|
||||
static int breath_widths[N_PEAKS] = {0,200,200,400,400,400,600,600,600};
|
||||
|
||||
// default is: pitch 82,118
|
||||
@@ -392,8 +395,8 @@ void VoiceReset(int tone_only)
|
||||
for(pk=0; pk<N_PEAKS; pk++)
|
||||
{
|
||||
voice->freq[pk] = 256;
|
||||
voice->height[pk] = 256;
|
||||
voice->width[pk] = 256;
|
||||
voice->height[pk] = default_heights[pk];
|
||||
voice->width[pk] = default_widths[pk]*2;
|
||||
voice->breath[pk] = 0;
|
||||
voice->breathw[pk] = breath_widths[pk]; // default breath formant woidths
|
||||
voice->freqadd[pk] = 0;
|
||||
|
||||
+2
-2
@@ -782,14 +782,14 @@ size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSiz
|
||||
if (out_channels == 2)
|
||||
{
|
||||
// copy with wrap around at the end of ringbuffer
|
||||
const size_t bytes_written = copyBuffer(myWrite, theMono16BitsWaveBuffer, aFreeMem/2);
|
||||
copyBuffer(myWrite, theMono16BitsWaveBuffer, aFreeMem/2);
|
||||
myWrite = myBuffer;
|
||||
myWrite += copyBuffer(myWrite, theMono16BitsWaveBuffer+aFreeMem/2, theSize - aFreeMem/2);
|
||||
}
|
||||
else // 1 channel (mono)
|
||||
{
|
||||
// copy with wrap around at the end of ringbuffer
|
||||
const size_t bytes_written = copyBuffer(myWrite, theMono16BitsWaveBuffer, aFreeMem);
|
||||
copyBuffer(myWrite, theMono16BitsWaveBuffer, aFreeMem);
|
||||
myWrite = myBuffer;
|
||||
myWrite += copyBuffer(myWrite, theMono16BitsWaveBuffer+aFreeMem, theSize - aFreeMem);
|
||||
} // end if (out_channels == 2)
|
||||
|
||||
Reference in New Issue
Block a user