mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-06 07:03:12 +00:00
[1.29] lang=en, minor changes to phonemes [I] [V] [aI] [eI]
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@80 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+2
-3
@@ -77,7 +77,6 @@ extern void MakeVowelLists(void);
|
||||
extern void FindPhonemesUsed(void);
|
||||
extern void DrawEnvelopes();
|
||||
extern int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, char *fname);
|
||||
extern char voice_name[];
|
||||
|
||||
static int markers_used[8];
|
||||
|
||||
@@ -2099,7 +2098,7 @@ wxString CompileAllDictionaries()
|
||||
return(_T(" No dictionaries"));
|
||||
}
|
||||
|
||||
strcpy(save_voice_name,voice_name);
|
||||
strcpy(save_voice_name,voice_name2);
|
||||
|
||||
sprintf(fname_log,"%s%s",path_dsource,"dict_log");
|
||||
log = fopen(fname_log,"w");
|
||||
@@ -2274,7 +2273,7 @@ fprintf(f_errors,"Refs %d, Reused %d\n",count_references,duplicate_references);
|
||||
fclose(f_phcontents);
|
||||
|
||||
LoadPhData();
|
||||
LoadVoice(voice_name,0);
|
||||
LoadVoice(voice_name2,0);
|
||||
Report();
|
||||
DrawEnvelopes();
|
||||
|
||||
|
||||
+10
-7
@@ -65,7 +65,6 @@ extern void MakeVowelLists(void);
|
||||
extern void MakeWordFreqList();
|
||||
|
||||
extern const char *dict_name;
|
||||
extern char voice_name[];
|
||||
|
||||
MyFrame *myframe = NULL;
|
||||
SpectDisplay *currentcanvas = NULL;
|
||||
@@ -197,6 +196,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxMDIParentFrame)
|
||||
EVT_MENU(MENU_SPEAK_STOP, MyFrame::OnSpeak)
|
||||
EVT_MENU(MENU_SPEAK_PAUSE, MyFrame::OnSpeak)
|
||||
EVT_MENU(MENU_SPEAK_VOICE, MyFrame::OnSpeak)
|
||||
EVT_MENU(MENU_SPEAK_VOICE_VARIANT, MyFrame::OnSpeak)
|
||||
EVT_MENU(MENU_LOAD_WAV, MyFrame::OnTools)
|
||||
EVT_MENU(MENU_VOWELCHART1, MyFrame::OnTools)
|
||||
EVT_MENU(MENU_VOWELCHART2, MyFrame::OnTools)
|
||||
@@ -266,7 +266,7 @@ wxSashLayoutWindow *win;
|
||||
|
||||
|
||||
// if(LoadVoice(voice_name,0) == NULL)
|
||||
if(SetVoiceByName(voice_name) != EE_OK)
|
||||
if(SetVoiceByName(voice_name2) != EE_OK)
|
||||
{
|
||||
if(error_flag==0)
|
||||
wxLogError(_T("Failed to load voice data"));
|
||||
@@ -274,7 +274,7 @@ wxSashLayoutWindow *win;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetVoiceTitle(voice_name);
|
||||
SetVoiceTitle(voice_name2);
|
||||
}
|
||||
WavegenSetVoice(voice);
|
||||
|
||||
@@ -531,10 +531,13 @@ void MyFrame::OnSpeak(wxCommandEvent& event)
|
||||
break;
|
||||
|
||||
case MENU_SPEAK_VOICE:
|
||||
transldlg->ReadVoice();
|
||||
// if(voicedlg != NULL)
|
||||
// voicedlg->WriteParams();
|
||||
SetVoiceTitle(voice_name);
|
||||
transldlg->ReadVoice(0);
|
||||
SetVoiceTitle(voice_name2);
|
||||
break;
|
||||
|
||||
case MENU_SPEAK_VOICE_VARIANT:
|
||||
transldlg->ReadVoice(1);
|
||||
SetVoiceTitle(voice_name2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -18,6 +18,7 @@ extern int progress_max;
|
||||
extern int gui_flag;
|
||||
|
||||
extern char *WavFileName();
|
||||
extern char voice_name2[40];
|
||||
|
||||
class SpectDisplay;
|
||||
|
||||
@@ -90,7 +91,7 @@ public:
|
||||
|
||||
void OnKey(wxKeyEvent& event);
|
||||
void SpeakFile(void);
|
||||
void ReadVoice(void);
|
||||
void ReadVoice(int variant);
|
||||
void OnCommand(wxCommandEvent& event);
|
||||
|
||||
private:
|
||||
@@ -141,6 +142,7 @@ enum {
|
||||
MENU_SPEAK_PAUSE,
|
||||
MENU_SPEAK_STOP,
|
||||
MENU_SPEAK_VOICE,
|
||||
MENU_SPEAK_VOICE_VARIANT,
|
||||
MENU_LOAD_WAV,
|
||||
|
||||
MENU_VOWELCHART,
|
||||
|
||||
@@ -80,6 +80,7 @@ wxMenuBar *MakeMenu(int type)
|
||||
// VOICE MENU
|
||||
voice_menu = new wxMenu;
|
||||
voice_menu->Append(MENU_SPEAK_VOICE, _("Select &Voice"));
|
||||
voice_menu->Append(MENU_SPEAK_VOICE_VARIANT, _("Select Voice Va&riant"));
|
||||
|
||||
// DATA MENU
|
||||
data_menu = new wxMenu;
|
||||
|
||||
+3
-3
@@ -37,7 +37,6 @@ extern void strncpy0(char *to,const char *from, int size);
|
||||
extern int GetNumeric(wxTextCtrl *t);
|
||||
extern void SetNumeric(wxTextCtrl *t, int value);
|
||||
extern int samplerate;
|
||||
extern char voice_name[40];
|
||||
|
||||
wxString path_spectload;
|
||||
wxString path_spectload2;
|
||||
@@ -53,6 +52,7 @@ wxString path_dir1;
|
||||
int option_speed=160;
|
||||
|
||||
char path_dsource[sizeof(path_home)+20];
|
||||
char voice_name2[40];
|
||||
|
||||
BEGIN_EVENT_TABLE(Options, wxDialog)
|
||||
EVT_BUTTON(wxID_SAVE,Options::OnCommand)
|
||||
@@ -174,7 +174,7 @@ void ConfigInit()
|
||||
pConfig->Read(_T("/wavepath"),&path_wave,wxEmptyString);
|
||||
pConfig->Read(_T("/speechpath"),&path_speech,wxEmptyString);
|
||||
pConfig->Read(_T("/voicename"),&string,wxEmptyString);
|
||||
strcpy(voice_name,string.mb_str(wxConvLocal));
|
||||
strcpy(voice_name2,string.mb_str(wxConvLocal));
|
||||
pConfig->Read(_T("/phsource"),&path_phsource,basedir+_T("/phsource"));
|
||||
pConfig->Read(_T("/phfile"),&path_phfile,path_phsource+_T("/phonemes"));
|
||||
pConfig->Read(_T("/dictsource"),&path_dictsource,basedir+_T("/dictsource"));
|
||||
@@ -199,7 +199,7 @@ 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("/voicename"),wxString(voice_name,wxConvLocal));
|
||||
pConfig->Write(_T("/voicename"),wxString(voice_name2,wxConvLocal));
|
||||
pConfig->Write(_T("/phsource"),path_phsource);
|
||||
pConfig->Write(_T("/phfile"),path_phfile);
|
||||
pConfig->Write(_T("/dictsource"),path_dictsource);
|
||||
|
||||
+1
-1
@@ -384,7 +384,7 @@ void SpectFrame::ApplyVoiceMods()
|
||||
int pk;
|
||||
char voice_name1[40];
|
||||
|
||||
strcpy(voice_name1, voice_name); // remember current voice name
|
||||
strcpy(voice_name1, voice_name2); // remember current voice name
|
||||
|
||||
if(LoadVoice(path_modifiervoice.mb_str(wxConvLocal),0x13) == NULL)
|
||||
{
|
||||
|
||||
+2
-2
@@ -35,8 +35,8 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.28.07 21.Aug.07";
|
||||
const int version_phdata = 0x012801;
|
||||
const char *version_string = "1.29 27.Aug.07";
|
||||
const int version_phdata = 0x012901;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
|
||||
@@ -646,7 +646,7 @@ SetLengthMods(tr,3); // all equal
|
||||
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
|
||||
tr->langopts.tone_numbers = 9;
|
||||
tr->langopts.ideographs = 1;
|
||||
tr->langopts.word_gap = 0x4; // length of a final vowel is less dependent on the next consonant
|
||||
tr->langopts.word_gap = 0x5; // length of a final vowel is less dependent on the next consonant, don't merge consonant with next word
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
+36
-8
@@ -243,24 +243,52 @@ void TranslDlg::SpeakFile(void)
|
||||
|
||||
|
||||
|
||||
void TranslDlg::ReadVoice()
|
||||
{//========================
|
||||
void TranslDlg::ReadVoice(int variant)
|
||||
{//===================================
|
||||
wxString path;
|
||||
wxString filename;
|
||||
char *p;
|
||||
char vname[40];
|
||||
char fname[sizeof(path_home)+10];
|
||||
|
||||
sprintf(fname,"%s/voices",path_home);
|
||||
path = wxFileSelector(_T("Load voice"),wxString(fname,wxConvLocal),_T(""),_T(""),_T("*"),wxOPEN);
|
||||
if(path.IsEmpty())
|
||||
return;
|
||||
if(variant)
|
||||
{
|
||||
// remove variant from the previous voice name
|
||||
if((p = strchr(voice_name2,'+')) != NULL)
|
||||
*p = 0;
|
||||
|
||||
filename = path.Mid(strlen(fname)+1);
|
||||
strcpy(fname,filename.mb_str(wxConvLocal));
|
||||
sprintf(fname,"%s/voices/!v",path_home);
|
||||
path = wxFileSelector(_T("Load voice variant"),wxString(fname,wxConvLocal),_T(""),_T(""),_T("*"),wxOPEN);
|
||||
if(path.IsEmpty())
|
||||
{
|
||||
strcpy(fname,voice_name2);
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = path.Mid(strlen(fname)+1);
|
||||
strcpy(vname,filename.mb_str(wxConvLocal));
|
||||
sprintf(fname,"%s+%s",voice_name2,vname);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(fname,"%s/voices",path_home);
|
||||
path = wxFileSelector(_T("Load voice"),wxString(fname,wxConvLocal),_T(""),_T(""),_T("*"),wxOPEN);
|
||||
if(path.IsEmpty())
|
||||
return;
|
||||
|
||||
filename = path.Mid(strlen(fname)+1);
|
||||
strcpy(fname,filename.mb_str(wxConvLocal));
|
||||
}
|
||||
|
||||
if(SetVoiceByName(fname) != EE_OK)
|
||||
{
|
||||
wxLogError(_T("Failed to load voice data"));
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(voice_name2,fname);
|
||||
}
|
||||
WavegenSetVoice(voice);
|
||||
}
|
||||
|
||||
|
||||
+17
-5
@@ -66,7 +66,6 @@ static int len_path_voices;
|
||||
|
||||
espeak_VOICE *voice_selected = NULL;
|
||||
espeak_VOICE *first_voice = NULL;
|
||||
char voice_name[40];
|
||||
|
||||
|
||||
|
||||
@@ -870,7 +869,6 @@ voice_t *LoadVoice(const char *vname, int control)
|
||||
if(!tone_only)
|
||||
{
|
||||
translator = new_translator;
|
||||
strcpy(voice_name,voicename);
|
||||
}
|
||||
|
||||
// relative lengths of different stress syllables
|
||||
@@ -978,7 +976,7 @@ static int __cdecl VoiceScoreSorter(const void *p1, const void *p2)
|
||||
|
||||
if((ix = v2->score - v1->score) != 0)
|
||||
return(ix);
|
||||
return(strcmp(v2->name,v1->name));
|
||||
return(strcmp(v1->name,v2->name));
|
||||
}
|
||||
|
||||
|
||||
@@ -1525,6 +1523,8 @@ ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec)
|
||||
{//========================================================================
|
||||
#ifndef PLATFORM_RISCOS
|
||||
int ix;
|
||||
int j;
|
||||
espeak_VOICE *v;
|
||||
static espeak_VOICE *voices[N_VOICES_LIST];
|
||||
char selected_voice_id[80];
|
||||
char path_voices[sizeof(path_home)+12];
|
||||
@@ -1570,9 +1570,21 @@ ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec)
|
||||
{
|
||||
// select the voices which match the voice_spec, and sort them by preference
|
||||
SetVoiceScores(voice_spec,voices,1);
|
||||
return((const espeak_VOICE **)voices);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
// omit variant voices
|
||||
j = 0;
|
||||
for(ix=0; (v = voices_list[ix]) != NULL; ix++)
|
||||
{
|
||||
if((v->languages[0] != 0) && (strcmp(&v->languages[1],"variant") != 0))
|
||||
{
|
||||
voices[j++] = v;
|
||||
}
|
||||
}
|
||||
voices[j] = NULL;
|
||||
}
|
||||
return((const espeak_VOICE **)voices);
|
||||
#endif
|
||||
return((const espeak_VOICE **)voices_list);
|
||||
} // end of espeak_ListVoices
|
||||
|
||||
+1
-2
@@ -40,7 +40,6 @@
|
||||
/* Read a file of vowel symbols and f1,f2 formants, and produce a vowel diagram
|
||||
*/
|
||||
extern wxString path_phsource;
|
||||
extern char voice_name[];
|
||||
|
||||
extern char *spects_data;
|
||||
extern int n_phoneme_tables;
|
||||
@@ -503,7 +502,7 @@ void MakeVowelLists(void)
|
||||
|
||||
VowelChart(1,fname); // draw the vowel chart
|
||||
}
|
||||
LoadVoice(voice_name,0); // reset the original phoneme table
|
||||
LoadVoice(voice_name2,0); // reset the original phoneme table
|
||||
delete progress;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user