[1.26.10] Lengthen phoneme [n] slightly.

Internationalization of Windows espeak and espeakedit installers.

git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@54 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-06-23 16:47:37 +00:00
parent 3c1fcdfdbe
commit 5414063759
50 changed files with 527 additions and 255 deletions
+2 -12
View File
@@ -139,16 +139,6 @@ extern void VoiceReset(int control);
CompileInit();
exit(0);
}
if(strcmp(param,"--lex=ru")==0)
{
if(LoadPhData() != 1)
{
fprintf(stderr,"Failed to load phoneme data\n");
exit(1);
}
CompareLexicon(MENU_LEXICON_RU);
exit(0);
}
}
gui_flag = 1;
@@ -531,8 +521,8 @@ void MyFrame::OnSpeak(wxCommandEvent& event)
case MENU_SPEAK_VOICE:
transldlg->ReadVoice();
if(voicedlg != NULL)
voicedlg->WriteParams();
// if(voicedlg != NULL)
// voicedlg->WriteParams();
SetVoiceTitle(voice_name);
break;
}
+1 -1
View File
@@ -86,7 +86,7 @@ class MyChild: public wxMDIChildFrame
void OnSaveAs(wxCommandEvent& event);
void OnSaveSelect(wxCommandEvent& event);
void OnSavePitchenv(wxCommandEvent& event);
void OnVoiceDlg(wxCommandEvent& event);
// void OnVoiceDlg(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
+44 -44
View File
@@ -41,8 +41,8 @@ wxMenuBar *MakeMenu(int type)
// FILE MENU
file_menu = new wxMenu;
file_menu->Append(MENU_SPECTRUM, _T("&Open"));
file_menu->Append(MENU_SPECTRUM2, _T("O&pen2"));
file_menu->Append(MENU_SPECTRUM, _("&Open"));
file_menu->Append(MENU_SPECTRUM2, _("O&pen2"));
// file_menu->Append(MENU_PROSODY, _T("&Prosody window"));
if(type==0)
{
@@ -50,89 +50,89 @@ wxMenuBar *MakeMenu(int type)
else
if(type==1)
{
file_menu->Append(SPECTSEQ_SAVE, _T("&Save"));
file_menu->Append(SPECTSEQ_SAVEAS, _T("Save &As"));
file_menu->Append(SPECTSEQ_SAVESELECT, _T("Save Selection"));
file_menu->Append(SPECTSEQ_SAVE, _("&Save"));
file_menu->Append(SPECTSEQ_SAVEAS, _("Save &As"));
file_menu->Append(SPECTSEQ_SAVESELECT, _("Save Selection"));
// file_menu->Append(SPECTSEQ_SAVEPITCH, _T("Save Pitch &Envelope"));
file_menu->Append(SPECTSEQ_CLOSE, _T("&Close"));
file_menu->Append(SPECTSEQ_CLOSE, _("&Close"));
// file_menu->Append(MENU_CLOSE_ALL, _T("Close &All"));
}
else
if(type==2)
{
file_menu->Append(SPECTSEQ_SAVE, _T("&Save"));
file_menu->Append(SPECTSEQ_SAVEAS, _T("Save &As"));
file_menu->Append(SPECTSEQ_SAVE, _("&Save"));
file_menu->Append(SPECTSEQ_SAVEAS, _("Save &As"));
// file_menu->Append(SPECTSEQ_SAVEPITCH, _T("Save Pitch &Envelope"));
file_menu->Append(SPECTSEQ_CLOSE, _T("&Close"));
file_menu->Append(SPECTSEQ_CLOSE, _("&Close"));
// file_menu->Append(MENU_CLOSE_ALL, _T("Close &All"));
}
file_menu->Append(MENU_QUIT, _T("&Quit"));
file_menu->Append(MENU_QUIT, _("&Quit"));
// SPEAK_MENU
speak_menu = new wxMenu;
speak_menu->Append(MENU_SPEAK_TRANSLATE, _T("&Translate"));
speak_menu->Append(MENU_SPEAK_RULES, _T("Show &Rules"));
speak_menu->Append(MENU_SPEAK_TEXT, _T("&Speak"));
speak_menu->Append(MENU_SPEAK_TRANSLATE, _("&Translate"));
speak_menu->Append(MENU_SPEAK_RULES, _("Show &Rules"));
speak_menu->Append(MENU_SPEAK_TEXT, _("&Speak"));
speak_menu->AppendSeparator();
speak_menu->Append(MENU_SPEAK_FILE, _T("Speak &file"));
speak_menu->Append(MENU_SPEAK_PAUSE, _T("&Pause"));
speak_menu->Append(MENU_SPEAK_STOP, _T("St&op"));
speak_menu->Append(MENU_SPEAK_FILE, _("Speak &file"));
speak_menu->Append(MENU_SPEAK_PAUSE, _("&Pause"));
speak_menu->Append(MENU_SPEAK_STOP, _("St&op"));
// VOICE MENU
voice_menu = new wxMenu;
voice_menu->Append(MENU_SPEAK_VOICE, _T("Select &Voice"));
voice_menu->Append(MENU_SPEAK_VOICE, _("Select &Voice"));
// DATA MENU
data_menu = new wxMenu;
data_menu->Append(MENU_COMPILE_PH, _T("Compile &phoneme data"));
data_menu->Append(MENU_COMPILE_DICT, _T("Compile &dictionary"));
data_menu->Append(MENU_COMPILE_MBROLA, _T("Compile &mbrola phonemes list"));
data_menu->Append(MENU_COMPILE_PH, _("Compile &phoneme data"));
data_menu->Append(MENU_COMPILE_DICT, _("Compile &dictionary"));
data_menu->Append(MENU_COMPILE_MBROLA, _("Compile &mbrola phonemes list"));
// OPTIONS MENU
paths_menu = new wxMenu;
paths_menu->Append(MENU_PATH1, _T("Phoneme data source"));
paths_menu->Append(MENU_PATH2, _T("Dictionary data source"));
paths_menu->Append(MENU_PATH3, _T("Synthesized sound WAV file"));
paths_menu->Append(MENU_PATH1, _("Phoneme data source"));
paths_menu->Append(MENU_PATH2, _("Dictionary data source"));
paths_menu->Append(MENU_PATH3, _("Synthesized sound WAV file"));
speak_menu->AppendSeparator();
paths_menu->Append(MENU_PATH4, _T("Voice file to modify formant peaks"));
paths_menu->Append(MENU_PATH4, _("Voice file to modify formant peaks"));
option_menu = new wxMenu;
option_menu->Append(MENU_PATHS, _T("Set &paths"), paths_menu);
option_menu->Append(MENU_PARAMS, _T("Speed"));
option_menu->Append(MENU_PATHS, _("Set &paths"), paths_menu);
option_menu->Append(MENU_PARAMS, _("Speed"));
// TOOLS
vowelchart_menu = new wxMenu;
vowelchart_menu->Append(MENU_VOWELCHART1, _T("From compiled phoneme data"));
vowelchart_menu->Append(MENU_VOWELCHART2, _T("From list of formants"));
vowelchart_menu->Append(MENU_VOWELCHART3, _T("From directory of vowel files"));
vowelchart_menu->Append(MENU_VOWELCHART1, _("From compiled phoneme data"));
vowelchart_menu->Append(MENU_VOWELCHART2, _("From list of formants"));
vowelchart_menu->Append(MENU_VOWELCHART3, _("From directory of vowel files"));
lexicon_menu = new wxMenu;
lexicon_menu->Append(MENU_LEXICON_RU, _T("Russian (lexicon.dict)"));
lexicon_menu->Append(MENU_LEXICON_DE, _T("German"));
lexicon_menu->Append(MENU_LEXICON_RU, _("Russian (lexicon.dict)"));
lexicon_menu->Append(MENU_LEXICON_DE, _("German"));
tools_menu = new wxMenu;
tools_menu->Append(MENU_VOWELCHART, _T("Make &Vowels Chart"), vowelchart_menu);
tools_menu->Append(MENU_VOWELCHART, _("Make &Vowels Chart"), vowelchart_menu);
// tools_menu->Append(MENU_LOAD_WAV, _T("Analyse WAV file"));
tools_menu->Append(MENU_LEXICON, _T("Compare &Lexicon"), lexicon_menu);
tools_menu->Append(MENU_TO_UTF8, _T("Convert file to &UTF8"));
tools_menu->Append(MENU_COUNT_WORDS, _T("Count word &frequencies"));
tools_menu->Append(MENU_TEST , _T("Test (temporary)"));
tools_menu->Append(MENU_LEXICON, _("Compare &Lexicon"), lexicon_menu);
tools_menu->Append(MENU_TO_UTF8, _("Convert file to &UTF8"));
tools_menu->Append(MENU_COUNT_WORDS, _("Count word &frequencies"));
tools_menu->Append(MENU_TEST , _("Test (temporary)"));
// tools_menu->Append(MENU_TEST2 , _T("Test2"));
// HELP MENU
help_menu = new wxMenu;
help_menu->Append(MENU_ABOUT, _T("&About"));
help_menu->Append(MENU_ABOUT, _("&About"));
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, _T("&File"));
menu_bar->Append(speak_menu, _T("&Speak"));
menu_bar->Append(voice_menu, _T("&Voice"));
menu_bar->Append(option_menu, _T("&Options"));
menu_bar->Append(tools_menu, _T("&Tools"));
menu_bar->Append(data_menu, _T("&Compile"));
menu_bar->Append(help_menu, _T("&Help"));
menu_bar->Append(file_menu, _("&File"));
menu_bar->Append(speak_menu, _("&Speak"));
menu_bar->Append(voice_menu, _("&Voice"));
menu_bar->Append(option_menu, _("&Options"));
menu_bar->Append(tools_menu, _("&Tools"));
menu_bar->Append(data_menu, _("&Compile"));
menu_bar->Append(help_menu, _("&Help"));
return(menu_bar);
} // end of MakeMenu
-3
View File
@@ -45,7 +45,6 @@ wxString path_spectload2;
wxString path_pitches;
wxString path_wave;
wxString path_speech;
wxString path_voices;
wxString path_phsource;
wxString path_dictsource;
wxString path_speaktext;
@@ -162,7 +161,6 @@ void ConfigInit()
pConfig->Read(_T("/pitchpath"),&path_pitches,basedir+_T("/pitch"));
pConfig->Read(_T("/wavepath"),&path_wave,wxEmptyString);
pConfig->Read(_T("/speechpath"),&path_speech,wxEmptyString);
pConfig->Read(_T("/voicepath"),&path_voices,basedir+_T("/voices"));
pConfig->Read(_T("/voicename"),&string,wxEmptyString);
strcpy(voice_name,string.mb_str(wxConvLocal));
pConfig->Read(_T("/phsource"),&path_phsource,basedir+_T("/phsource"));
@@ -189,7 +187,6 @@ void ConfigSave(int exit)
pConfig->Write(_T("/pitchpath"),path_pitches);
pConfig->Write(_T("/wavepath"),path_wave);
pConfig->Write(_T("/speechpath"),path_speech);
pConfig->Write(_T("/voicepath"),path_voices);
pConfig->Write(_T("/voicename"),wxString(voice_name,wxConvLocal));
pConfig->Write(_T("/phsource"),path_phsource);
pConfig->Write(_T("/dictsource"),path_dictsource);
-1
View File
@@ -32,7 +32,6 @@ extern void ConfigSetPaths();
extern wxString path_spectload;
extern wxString path_spectload2;
extern wxString path_pitches;
extern wxString path_voices;
extern wxString path_phsource;
extern wxString path_dictsource;
extern wxString path_modifiervoice;
+1 -1
View File
@@ -85,7 +85,7 @@
#define phPLACE 0xf0000
#define phPLACE_pla 0x60000
#define N_PHONEME_TABS 50 // number of phoneme tables
#define N_PHONEME_TABS 100 // number of phoneme tables
#define N_PHONEME_TAB 256 // max phonemes in a phoneme table
#define N_PHONEME_TAB_NAME 32 // must be multiple of 4
+1
View File
@@ -186,6 +186,7 @@ void SetParameter(int parameter, int value, int relative)
case espeakPITCH:
if(new_value > 99) new_value = 99;
if(new_value < 0) new_value = 0;
embedded_value[EMBED_P] = new_value;
break;
+17 -1
View File
@@ -202,7 +202,6 @@ void DisplayVoices(FILE *f_out, char *language)
static void PitchAdjust(int pitch_adjustment)
{//==========================================
int ix, factor;
extern unsigned char pitch_adjust_tab[100];
voice->pitch_base = (voice->pitch_base * pitch_adjust_tab[pitch_adjustment])/128;
@@ -228,8 +227,16 @@ static void init_path(void)
HKEY RegKey;
unsigned long size;
unsigned long var_type;
char *env;
unsigned char buf[100];
if((env = getenv("espeak-path")) != NULL)
{
sprintf(path_home,"%s/espeak-data",env);
if(GetFileLength(path_home) == -2)
return; // an espeak-data directory exists
}
buf[0] = 0;
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Speech\\Voices\\Tokens\\eSpeak", 0, KEY_READ, &RegKey);
size = sizeof(buf);
@@ -238,6 +245,15 @@ static void init_path(void)
sprintf(path_home,"%s\\espeak-data",buf);
#else
char *env;
if((env = getenv("ESPEAK-DATA-PATH")) != NULL)
{
snprintf(path_home,sizeof(path_home),"%s/espeak-data",env);
if(GetFileLength(path_home) == -2)
return; // an espeak-data directory exists
}
snprintf(path_home,sizeof(path_home),"%s/espeak-data",getenv("HOME"));
if(access(path_home,R_OK) != 0)
{
+18
View File
@@ -283,6 +283,7 @@ static void init_path(const char *path)
HKEY RegKey;
unsigned long size;
unsigned long var_type;
char *env;
unsigned char buf[100];
if(path != NULL)
@@ -290,6 +291,14 @@ static void init_path(const char *path)
sprintf(path_home,"%s/espeak-data",path);
return;
}
if((env = getenv("espeak-path")) != NULL)
{
sprintf(path_home,"%s/espeak-data",env);
if(GetFileLength(path_home) == -2)
return; // an espeak-data directory exists
}
buf[0] = 0;
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Speech\\Voices\\Tokens\\eSpeak", 0, KEY_READ, &RegKey);
size = sizeof(buf);
@@ -299,12 +308,21 @@ static void init_path(const char *path)
sprintf(path_home,"%s\\espeak-data",buf);
#else
char *env;
if(path != NULL)
{
snprintf(path_home,sizeof(path_home),"%s/espeak-data",path);
return;
}
if((env = getenv("ESPEAK-DATA-PATH")) != NULL)
{
snprintf(path_home,sizeof(path_home),"%s/espeak-data",env);
if(GetFileLength(path_home) == -2)
return; // an espeak-data directory exists
}
snprintf(path_home,sizeof(path_home),"%s/espeak-data",getenv("HOME"));
if(access(path_home,R_OK) != 0)
{
+1 -1
View File
@@ -1007,7 +1007,7 @@ void InitSpectrumDisplay()
menu_spectdisplay->Append(207,_T("Hide Interpolation CTRL+SHIFT+Q"));
menu_spectdisplay->Append(205,_T("Zero Peaks CTRL+Z"));
menu_spectdisplay->Append(210,_T("Toggle Marker"),menu_markers);
menu_spectdisplay->Append(211,_T("Apply the formant adjustments from current voice"));
menu_spectdisplay->Append(211,_T("Apply the formant adjustments from a voice file"));
menu_spectdisplay->AppendSeparator();
menu_spectdisplay->Append(208,_T("Play Selected Frame F1"));
menu_spectdisplay->Append(209,_T("Play All F2"));
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.26.09 20.Jun.07";
const char *version_string = "1.26.10 23.Jun.07";
const int version_phdata = 0x012601;
int option_device_number = -1;
-2
View File
@@ -67,8 +67,6 @@ static voice_t *new_voice=NULL;
int n_soundicon_tab=0;
SOUND_ICON soundicon_tab[N_SOUNDICON_TAB];
#define RMS1 16 //
#define RMS2 20 // 16 - 20
#define RMS_GLOTTAL1 35 // vowel before glottal stop
#define RMS_START 28 // 14 - 30
+2
View File
@@ -150,6 +150,8 @@ extern unsigned char env_fall[128];
extern unsigned char env_rise[128];
extern unsigned char env_frise[128];
#define MAX_PITCH_VALUE 101
extern unsigned char pitch_adjust_tab[MAX_PITCH_VALUE+1];
// queue of commands for wavegen
#define WCMD_AMPLITUDE 1
+3 -1
View File
@@ -287,7 +287,7 @@ const unsigned short *charsets[N_CHARSETS] = {
// use this table if vowel is not the last in the word
static unsigned char length_mods_en[100] = {
/* a , t s n d z r N <- next */
100,120,100,105, 95,110,110,100, 95, 100, /* a <- next2 */
100,120,100,105,100,110,110,100, 95, 100, /* a <- next2 */
105,120,105,110,125,130,135,115,125, 100, /* , */
105,120, 75,100, 75,105,120, 85, 75, 100, /* t */
105,120, 85,105, 95,115,120,100, 95, 100, /* s */
@@ -846,6 +846,8 @@ strcpy(phonemes2,phonemes);
// if(found || (dictionary_flags2 != 0))
// prefix_flags = 1; // ?? this looks wrong
if((found==0) && (dictionary_flags2 != 0))
prefix_flags = 1;
}
if(found == 0)
{
+4 -3
View File
@@ -188,11 +188,11 @@ void VoiceDlg::OnCommand(wxCommandEvent& event)
break;
case VD_LOAD:
Load();
// Load();
break;
case VD_SAVE:
Save();
// Save();
break;
case VD_USEPITCH:
@@ -260,6 +260,7 @@ void VoiceDlg::OnSpin(wxSpinEvent& event)
ReadParams();
}
#ifdef deleted
void VoiceDlg::Save()
{//==================
int pk;
@@ -326,7 +327,7 @@ void VoiceDlg::Load()
SetSpinCtrl(voicedlg->vd_pitch2,pitch2);
ReadParams();
} // end of VoiceDlg::Load
#endif
void VoiceDlg::SetFromSpect(SpectSeq* spect)
{//=========================================
+15 -5
View File
@@ -144,7 +144,7 @@ int wcmdq_tail=0;
// pitch,speed,
int embedded_default[N_EMBEDDED_VALUES] = {0,50,170,100,50, 0,50, 0,170,0,0,0,0,0};
static int embedded_max[N_EMBEDDED_VALUES] = {0,99,360,300,99,99,99, 0,360,0,0,0,0,4};
static int embedded_max[N_EMBEDDED_VALUES] = {0,0x7fff,360,300,99,99,99, 0,360,0,0,0,0,4};
#define N_CALLBACK_IX N_WAV_BUF-2 // adjust this delay to match display with the currently spoken word
int current_source_index=0;
@@ -303,7 +303,7 @@ static unsigned char wavemult[N_WAVEMULT] = {
// set from y = pow(2,x) * 128, x=-1 to 1
unsigned char pitch_adjust_tab[100] = {
unsigned char pitch_adjust_tab[MAX_PITCH_VALUE+1] = {
64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 86, 87, 88,
@@ -316,7 +316,7 @@ unsigned char pitch_adjust_tab[100] = {
174,176,179,181,184,186,189,191,
194,197,199,202,205,208,211,214,
217,220,223,226,229,232,236,239,
242,246,249,252 };
242,246,249,252, 254,255 };
int WavegenFill(int fill_zeros);
@@ -1440,6 +1440,7 @@ void SetEmbedded(int control, int value)
int command;
int ix;
int factor;
int pitch_value;
command = control & 0x1f;
if((control & 0x60) == 0x60)
@@ -1462,7 +1463,10 @@ void SetEmbedded(int control, int value)
case EMBED_P:
case EMBED_T:
// adjust formants to give better results for a different voice pitch
factor = 256 + (25 * (embedded_value[EMBED_P] - 50))/50;
if((pitch_value = embedded_value[EMBED_P]) > MAX_PITCH_VALUE)
pitch_value = MAX_PITCH_VALUE;
factor = 256 + (25 * (pitch_value - 50))/50;
for(ix=0; ix<=5; ix++)
{
wvoice->freq[ix] = (wvoice->freq2[ix] * factor)/256;
@@ -1521,6 +1525,7 @@ void SetPitch(int length, unsigned char *env, int pitch1, int pitch2)
int x;
int base;
int range;
int pitch_value;
#ifdef LOG_FRAMES
f_log=fopen("log-espeakedit","a");
@@ -1547,7 +1552,12 @@ f_log=NULL;
pitch2 = x;
}
base = (wvoice->pitch_base * pitch_adjust_tab[embedded_value[EMBED_P]])/128;
if((pitch_value = embedded_value[EMBED_P]) > MAX_PITCH_VALUE)
pitch_value = MAX_PITCH_VALUE;
if(pitch_value < 0)
pitch_value = 0;
base = (wvoice->pitch_base * pitch_adjust_tab[pitch_value])/128;
range = (wvoice->pitch_range * embedded_value[EMBED_R])/50;
// compensate for change in pitch when the range is narrowed or widened