Moves "wisper" and "croak" into voices/!v. Voice variants can now be specified as en+wisper, en+f2 (for female 2), etc. espeak --voices=variant lists the voice variants. Moves some lines from speech.h into other header files. Possible fix for data version check on big-endian. Fixed crash error iin LoadConfig(). Fixed crash in espeakedit: press Tab in enpty Prosody window. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@74 d46cf337-b52f-0410-862d-fd96e6ae7743master
| @@ -43,6 +43,9 @@ _— g@d'ank@nSt@-*,IC | |||
| _#9 t,abu:l'Ato:* | |||
| _#32 l'e:*ts'aIC@n | |||
| // Not Roman numbers | |||
| v faU | |||
| x Iks | |||
| // Numbers | |||
| //======== | |||
| @@ -1,18 +0,0 @@ | |||
| name male1 | |||
| gender male 70 | |||
| pitch 74 109 | |||
| flutter 4 | |||
| roughness 4 | |||
| formant 0 98 95 100 | |||
| formant 1 98 95 100 | |||
| formant 2 97 95 100 | |||
| formant 3 97 100 100 | |||
| formant 4 97 100 100 | |||
| formant 5 105 100 100 | |||
| formant 6 95 100 100 | |||
| formant 7 100 100 100 | |||
| formant 8 100 100 100 | |||
| stressAdd -10 -10 -20 -20 0 0 40 70 | |||
| @@ -1,16 +0,0 @@ | |||
| gender female | |||
| pitch 140 200 | |||
| flutter 7 | |||
| roughness 4 | |||
| formant 0 115 80 150 | |||
| formant 1 120 70 187 | |||
| formant 2 110 70 150 | |||
| formant 3 115 70 150 | |||
| formant 4 110 70 150 | |||
| formant 5 110 90 150 | |||
| formant 6 105 80 150 | |||
| formant 7 110 70 150 | |||
| formant 8 110 70 150 | |||
| stressAdd -10 -10 -20 -20 0 0 40 70 | |||
| @@ -1,14 +0,0 @@ | |||
| gender female | |||
| pitch 140 220 | |||
| formant 0 105 80 150 | |||
| formant 1 110 80 160 | |||
| formant 2 110 70 150 | |||
| formant 3 110 70 150 | |||
| formant 4 115 70 150 | |||
| formant 5 115 70 150 | |||
| formant 6 110 70 150 | |||
| formant 7 110 70 150 | |||
| formant 8 110 70 150 | |||
| stressAdd 0 0 -10 -10 0 0 10 40 | |||
| @@ -1,15 +0,0 @@ | |||
| gender female | |||
| pitch 150 230 | |||
| formant 0 105 80 150 | |||
| formant 1 110 80 150 | |||
| formant 2 120 70 150 | |||
| formant 3 125 70 150 | |||
| formant 4 125 70 150 | |||
| formant 5 125 80 150 | |||
| formant 6 120 70 150 | |||
| formant 7 110 70 150 | |||
| formant 8 110 70 150 | |||
| stressAmp 18 18 20 20 20 20 20 20 | |||
| breath 0 5 7 7 7 6 6 5 | |||
| @@ -1,16 +0,0 @@ | |||
| gender female | |||
| echo 130 15 | |||
| pitch 145 200 | |||
| formant 0 120 80 150 | |||
| formant 1 115 70 160 | |||
| formant 2 125 80 150 | |||
| formant 3 125 80 150 | |||
| formant 4 125 80 150 | |||
| formant 5 125 80 150 | |||
| formant 6 110 80 150 | |||
| formant 7 110 75 150 | |||
| formant 8 110 75 150 | |||
| stressAdd -20 -20 -20 -20 0 0 60 90 | |||
| stressAmp 18 16 20 20 20 20 20 20 | |||
| @@ -1,13 +0,0 @@ | |||
| gender male | |||
| pitch 88 115 | |||
| echo 130 15 | |||
| formant 0 100 80 120 | |||
| formant 1 90 85 120 | |||
| formant 2 110 85 120 | |||
| formant 3 105 90 120 | |||
| formant 4 100 90 120 | |||
| formant 5 100 90 120 | |||
| formant 6 100 90 120 | |||
| formant 7 100 90 120 | |||
| formant 8 100 90 120 | |||
| @@ -1,14 +0,0 @@ | |||
| gender male | |||
| pitch 80 122 | |||
| formant 0 100 100 100 | |||
| formant 1 96 97 100 | |||
| formant 2 96 97 100 | |||
| formant 3 96 103 100 | |||
| formant 4 95 103 100 | |||
| formant 5 95 103 100 | |||
| formant 6 100 100 100 | |||
| formant 7 100 100 100 | |||
| formant 8 100 100 100 | |||
| stressAdd 10 10 0 0 0 0 -30 -30 | |||
| @@ -1,15 +0,0 @@ | |||
| gender male | |||
| pitch 70 110 | |||
| formant 0 103 100 100 | |||
| formant 1 103 100 100 | |||
| formant 2 103 100 100 | |||
| formant 3 103 100 100 | |||
| formant 4 106 100 100 | |||
| formant 5 106 100 100 | |||
| formant 6 106 100 100 | |||
| formant 7 103 100 100 | |||
| formant 8 103 100 100 | |||
| stressAdd -10 -10 -30 -30 0 0 60 90 | |||
| @@ -1,13 +0,0 @@ | |||
| gender male | |||
| pitch 90 130 | |||
| formant 0 100 85 130 | |||
| formant 1 105 85 130 | |||
| formant 2 105 85 130 | |||
| formant 3 105 85 130 | |||
| formant 4 105 85 130 | |||
| formant 5 105 85 130 | |||
| formant 6 105 85 150 | |||
| formant 7 105 85 150 | |||
| formant 8 105 85 150 | |||
| @@ -1,11 +0,0 @@ | |||
| gender male | |||
| pitch 82 117 | |||
| formant 0 100 90 120 | |||
| formant 1 100 90 140 | |||
| formant 2 100 70 140 | |||
| formant 3 100 75 140 | |||
| formant 4 100 80 140 | |||
| formant 5 100 80 140 | |||
| @@ -1,16 +0,0 @@ | |||
| pitch 85 117 | |||
| flutter 20 | |||
| formant 0 100 80 110 | |||
| formant 1 100 100 100 | |||
| formant 2 100 100 100 | |||
| formant 3 100 100 100 | |||
| formant 4 110 100 100 | |||
| formant 5 110 100 100 | |||
| formant 6 100 100 100 | |||
| formant 7 100 100 100 | |||
| formant 8 100 100 100 | |||
| @@ -1,15 +0,0 @@ | |||
| name english-wisper | |||
| language en-uk 10 | |||
| language en 10 | |||
| gender male | |||
| pitch 82 117 | |||
| formant 0 100 0 100 | |||
| formant 1 100 80 100 | |||
| flutter 20 | |||
| voicing 17 | |||
| breath 75 75 50 40 15 10 | |||
| breathw 150 150 200 200 400 400 | |||
| @@ -330,12 +330,11 @@ endphoneme | |||
| phoneme t // dental variant of /t/ | |||
| vls dnt stop | |||
| vowelin f1=1 f2=1500 -300 300 f3=-100 80 amp=18 | |||
| vowelin f1=1 f2=1500 -250 250 f3=-100 80 amp=16 | |||
| vowelout f1=0 f2=1500 -300 250 f3=-100 80 rms=20 | |||
| lengthmod 2 | |||
| wave ustop/t_hi%60 | |||
| before _ ustop/t_dnt%35 | |||
| // before _ ustop/t_hi%35 | |||
| switchvoicing d | |||
| endphoneme | |||
| @@ -30,11 +30,11 @@ | |||
| #include "speak_lib.h" | |||
| #include "main.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #include "options.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #define tNUMBER 1 | |||
| @@ -33,10 +33,10 @@ | |||
| #include "speak_lib.h" | |||
| #include "main.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "options.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #include "translate.h" | |||
| #include "prosodydisplay.h" | |||
| @@ -28,10 +28,10 @@ | |||
| #include "speak_lib.h" | |||
| #include "main.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #include "translate.h" | |||
| #include "options.h" | |||
| @@ -24,8 +24,11 @@ | |||
| #include "wx/mdi.h" | |||
| #include "speak_lib.h" | |||
| #include "main.h" | |||
| #include "speech.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| @@ -25,9 +25,9 @@ | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "translate.h" | |||
| @@ -20,6 +20,7 @@ | |||
| #include "wx/wx.h" | |||
| #include "wx/fileconf.h" | |||
| #include "wx/filename.h" | |||
| #include <sys/stat.h> | |||
| #include "speech.h" | |||
| @@ -125,7 +125,7 @@ void ProsodyDisplay::SelectPh(int index) | |||
| if(index < 0) return; | |||
| p = &phlist[index]; | |||
| if(p == NULL) return; | |||
| if((p == NULL) || (p->ph == NULL)) return; | |||
| sprintf(buf,"Stress %d Amp %2d LenMod %2d Pitch %3d %3d [env=%d] Flags %.2x ", | |||
| p->tone,p->amp,p->length,p->pitch1,p->pitch2,p->env,p->ph->phflags); | |||
| @@ -293,7 +293,14 @@ void ProsodyDisplay::OnKey(wxKeyEvent& event) | |||
| p->length++; | |||
| break; | |||
| case WXK_TAB: | |||
| display = 0; | |||
| event.Skip(); | |||
| transldlg->SetFocus(); | |||
| break; | |||
| default: | |||
| display = 0; | |||
| event.Skip(); | |||
| break; | |||
| } | |||
| @@ -29,9 +29,9 @@ | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "translate.h" | |||
| #include <locale.h> | |||
| @@ -25,9 +25,9 @@ | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "translate.h" | |||
| extern int GetAmplitude(void); | |||
| @@ -43,9 +43,9 @@ | |||
| #include <sys/stat.h> | |||
| #include "speak_lib.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "translate.h" | |||
| @@ -36,9 +36,9 @@ | |||
| #endif | |||
| #include "speak_lib.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "translate.h" | |||
| #include "debug.h" | |||
| @@ -265,7 +265,7 @@ int GetFileLength(const char *filename) | |||
| char *Alloc(int size) | |||
| {//================== | |||
| char *p; | |||
| if((p = (char *)malloc(size+1)) == NULL) | |||
| if((p = (char *)malloc(size)) == NULL) | |||
| fprintf(stderr,"Can't allocate memory\n"); // I was told that size+1 fixes a crash on 64-bit systems | |||
| return(p); | |||
| } | |||
| @@ -23,9 +23,9 @@ | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "main.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #include "options.h" | |||
| #include "wx/txtstrm.h" | |||
| @@ -29,8 +29,11 @@ | |||
| #include <ctype.h> | |||
| #include "main.h" | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "main.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #include "options.h" | |||
| @@ -21,7 +21,10 @@ | |||
| #include "wx/wx.h" | |||
| #include <math.h> | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #include "main.h" | |||
| @@ -54,9 +54,6 @@ typedef double DOUBLEX; | |||
| #define N_PEAKS 9 | |||
| #define N_MARKERS 8 | |||
| typedef struct { | |||
| const char *mnem; | |||
| @@ -65,32 +62,12 @@ typedef struct { | |||
| int LookupMnem(MNEM_TAB *table, char *string); | |||
| typedef struct { | |||
| short pkfreq; | |||
| short pkheight; | |||
| short pkwidth; | |||
| short pkright; | |||
| } peak_t; | |||
| typedef struct { | |||
| short frflags; | |||
| unsigned char length; | |||
| unsigned char rms; | |||
| short ffreq[9]; | |||
| unsigned char fheight[9]; | |||
| unsigned char fwidth[6]; // width/4 | |||
| unsigned char fright[6]; // width/4 | |||
| } frame_t; | |||
| int GetFileLength(const char *filename); | |||
| char *Alloc(int size); | |||
| void Free(void *ptr); | |||
| #define N_PATH_HOME 120 | |||
| extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
| extern const char *version_string; | |||
| extern const int version_phdata; | |||
| extern void strncpy0(char *to,const char *from, int size); | |||
| int GetFileLength(const char *filename); | |||
| char *Alloc(int size); | |||
| void Free(void *ptr); | |||
| @@ -29,13 +29,13 @@ | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "translate.h" | |||
| #include "wave.h" | |||
| const char *version_string = "1.28.04 15.Aug.07"; | |||
| const char *version_string = "1.28.05 17.Aug.07"; | |||
| const int version_phdata = 0x012801; | |||
| int option_device_number = -1; | |||
| @@ -125,7 +125,13 @@ int LoadPhData() | |||
| return(-1); | |||
| wavefile_data = (unsigned char *)spects_data; | |||
| version = *((unsigned int *)spects_data); | |||
| // read the version number from the first 4 bytes of phondata | |||
| version = 0; | |||
| for(ix=0; ix<4; ix++) | |||
| { | |||
| version += (wavefile_data[ix] << (ix*8)); | |||
| } | |||
| if(version != version_phdata) | |||
| { | |||
| result = version; | |||
| @@ -635,7 +641,7 @@ void LoadConfig(void) | |||
| if(ix==2) | |||
| { | |||
| soundicon_tab[n_soundicon_tab].name = c1; | |||
| p = Alloc(strlen(string+1)); | |||
| p = Alloc(strlen(string)+1); | |||
| strcpy(p,string); | |||
| soundicon_tab[n_soundicon_tab].filename = p; | |||
| soundicon_tab[n_soundicon_tab++].length = 0; | |||
| @@ -28,9 +28,9 @@ | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "translate.h" | |||
| #define PITCHfall 0 | |||
| @@ -65,6 +65,28 @@ extern int embedded_value[N_EMBEDDED_VALUES]; | |||
| extern int embedded_default[N_EMBEDDED_VALUES]; | |||
| #define N_PEAKS 9 | |||
| #define N_MARKERS 8 | |||
| typedef struct { | |||
| short pkfreq; | |||
| short pkheight; | |||
| short pkwidth; | |||
| short pkright; | |||
| } peak_t; | |||
| typedef struct { | |||
| short frflags; | |||
| unsigned char length; | |||
| unsigned char rms; | |||
| short ffreq[9]; | |||
| unsigned char fheight[9]; | |||
| unsigned char fwidth[6]; // width/4 | |||
| unsigned char fright[6]; // width/4 | |||
| } frame_t; | |||
| // formant data used by wavegen | |||
| typedef struct { | |||
| int freq; // Hz<<16 | |||
| @@ -237,6 +259,8 @@ extern int event_list_ix; | |||
| extern espeak_EVENT *event_list; | |||
| extern t_espeak_callback* synth_callback; | |||
| extern int option_log_frames; | |||
| extern const char *version_string; | |||
| extern const int version_phdata; | |||
| #define N_SOUNDICON_TAB 100 | |||
| extern int n_soundicon_tab; | |||
| @@ -29,9 +29,9 @@ | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "translate.h" | |||
| #define WORD_STRESS_CHAR '*' | |||
| @@ -25,9 +25,9 @@ | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "phoneme.h" | |||
| #include "voice.h" | |||
| #include "main.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "translate.h" | |||
| #include "prosodydisplay.h" | |||
| @@ -21,8 +21,11 @@ | |||
| #include "wx/wx.h" | |||
| #include "speak_lib.h" | |||
| #include "main.h" | |||
| #include "speech.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #include "options.h" | |||
| @@ -35,9 +35,9 @@ | |||
| #endif | |||
| #include "speak_lib.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "translate.h" | |||
| @@ -306,26 +306,6 @@ static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname, const char*lea | |||
| if(n_languages == 0) | |||
| { | |||
| #ifdef deleted | |||
| // Read voice variant files | |||
| // Don't use this, instead preset the variants_* arrays | |||
| // no language is specified, this voice file only affects the voice characteristics | |||
| if(memcmp(leafname,"!variant",8)==0) | |||
| { | |||
| if(((variant = atoi(&leafname[8])) > 0) && (strlen(variants_either) < N_VOICE_VARIANTS)) | |||
| { | |||
| char string[2]; | |||
| string[0] = variant; | |||
| string[1] = 0; | |||
| strcat(variants_either,string); | |||
| if(gender == 1) | |||
| strcat(variants_male,string); | |||
| if(gender == 2) | |||
| strcat(variants_female,string); | |||
| } | |||
| } | |||
| #endif | |||
| return(NULL); // no language lines in the voice file | |||
| } | |||
| @@ -442,11 +422,17 @@ static void VoiceFormant(char *p) | |||
| static voice_t *VoiceLookup(char *voicename) | |||
| {//========================================= | |||
| // Keep a cache of previously used voices. | |||
| int ix; | |||
| voice_t *v; | |||
| for(ix=0; ix < N_VOICES; ix++) | |||
| { | |||
| if((ix < n_voices_tab) && (strcmp(voices_tab[ix]->name,voicename)==0)) | |||
| { | |||
| return(voices_tab[ix]); // found the entry for the specified voice name | |||
| } | |||
| if(ix == n_voices_tab) | |||
| { | |||
| // found a free slot | |||
| @@ -457,13 +443,8 @@ static voice_t *VoiceLookup(char *voicename) | |||
| strncpy0(v->name,voicename,sizeof(v->name)); | |||
| return(v); | |||
| } | |||
| else | |||
| if(strcmp(voices_tab[ix]->name,voicename)==0) | |||
| { | |||
| return(voices_tab[ix]); // found the entry for the specified voice name | |||
| } | |||
| } | |||
| return(NULL); // table is full | |||
| return(voices_tab[0]); // table is full, reuse the first entry | |||
| } // end of VoiceLookup | |||
| @@ -640,6 +621,9 @@ voice_t *LoadVoice(const char *vname, int control) | |||
| break; | |||
| sscanf(p,"%s",language_name); | |||
| if(strcmp(language_name,"variant")==0) | |||
| break; | |||
| language_type = strtok(language_name,"-"); | |||
| language_set = 1; | |||
| strcpy(translator_name,language_type); | |||
| @@ -908,24 +892,63 @@ voice_t *LoadVoice(const char *vname, int control) | |||
| } // end of LoadVoice | |||
| voice_t *LoadVoiceVariant(const char *vname, int variant) | |||
| {//====================================================== | |||
| voice_t *v; | |||
| char *ExtractVoiceVariantName(char *vname, int variant_num) | |||
| {//======================================================== | |||
| // Remove any voice variant suffix (name or number) from a voice name | |||
| // Returns the voice variant name | |||
| char *p; | |||
| char buf[40]; | |||
| static char variant_name[20]; | |||
| variant_name[0] = 0; | |||
| strcpy(buf,vname); | |||
| if((p = strchr(buf,'+')) != NULL) | |||
| if((p = strchr(vname,'+')) != NULL) | |||
| { | |||
| // The voice name has a +variant suffix | |||
| *p = 0; | |||
| variant = atoi(p+1); | |||
| *p++ = 0; // delete the suffix from the voice name | |||
| if(isdigit(*p)) | |||
| { | |||
| variant_num = atoi(p); // variant number | |||
| } | |||
| else | |||
| { | |||
| // voice variant name, not number | |||
| strcpy(variant_name,"!v/"); | |||
| strncpy0(&variant_name[3],p,sizeof(variant_name)-3); | |||
| } | |||
| } | |||
| if(variant_num > 0) | |||
| { | |||
| if(variant_num < 10) | |||
| sprintf(variant_name,"!v/m%d",variant_num); // male | |||
| else | |||
| sprintf(variant_name,"!v/f%d",variant_num-10); // female | |||
| } | |||
| v = LoadVoice(buf,0); | |||
| if((v != NULL) && (variant > 0)) | |||
| return(variant_name); | |||
| } // end of ExtractVoiceVariantName | |||
| voice_t *LoadVoiceVariant(const char *vname, int variant_num) | |||
| {//========================================================== | |||
| // Load a voice file. | |||
| // Also apply a voice variant if specified by "variant", or by "+number" or "+name" in the "vname" | |||
| voice_t *v; | |||
| char *variant_name; | |||
| char buf[60]; | |||
| strncpy0(buf,vname,sizeof(buf)); | |||
| variant_name = ExtractVoiceVariantName(buf,variant_num); | |||
| if((v = LoadVoice(buf,0)) == NULL) | |||
| return(NULL); | |||
| if(variant_name[0] != 0) | |||
| { | |||
| sprintf(buf,"!varnt%d",variant); // changed from !variant1 to !varnt1 to avoid 8 char filenames on DOS | |||
| v = LoadVoice(buf,2); | |||
| v = LoadVoice(variant_name,2); | |||
| } | |||
| return(v); | |||
| } | |||
| @@ -982,6 +1005,12 @@ static int ScoreVoice(espeak_VOICE *voice_spec, int spec_n_parts, int spec_lang_ | |||
| } | |||
| else | |||
| { | |||
| if((*p == 0) && (strcmp(voice_spec->languages,"variants")==0)) | |||
| { | |||
| // match on a voice with no languages if the required language is "variants" | |||
| score = 100; | |||
| } | |||
| // compare the required language with each of the languages of this voice | |||
| while(*p != 0) | |||
| { | |||
| @@ -1337,6 +1366,7 @@ void GetVoices(const char *path) | |||
| HANDLE hFind = INVALID_HANDLE_VALUE; | |||
| DWORD dwError; | |||
| #undef UNICODE // we need FindFirstFileA() which takes an 8-bit c-string | |||
| sprintf(fname,"%s\\*",path); | |||
| hFind = FindFirstFile(fname, &FindFileData); | |||
| if(hFind == INVALID_HANDLE_VALUE) | |||
| @@ -1420,21 +1450,14 @@ espeak_ERROR SetVoiceByName(const char *name) | |||
| {//========================================= | |||
| espeak_VOICE *v; | |||
| espeak_VOICE voice_selector; | |||
| int variant=0; | |||
| char *p; | |||
| char variant_name[20]; | |||
| char *variant_name; | |||
| static char buf[60]; | |||
| strncpy0(buf,name,sizeof(buf)); | |||
| if((p = strchr(buf,'+')) != NULL) | |||
| { | |||
| // remove the voice variant suffix, from eg. en+3 | |||
| *p = 0; | |||
| variant = atoi(p+1); | |||
| } | |||
| variant_name = ExtractVoiceVariantName(buf,0); | |||
| memset(&voice_selector,0,sizeof(voice_selector)); | |||
| voice_selector.name = (char *)name; | |||
| voice_selector.name = buf; | |||
| // first check for a voice with this filename | |||
| // This may avoid the need to call espeak_ListVoices(). | |||
| @@ -1443,10 +1466,8 @@ espeak_ERROR SetVoiceByName(const char *name) | |||
| { | |||
| voice_selected = first_voice; | |||
| if(variant > 0) | |||
| if(variant_name[0] != 0) | |||
| { | |||
| // apply a voice variant | |||
| sprintf(variant_name,"!varnt%d",variant); | |||
| LoadVoice(variant_name,2); | |||
| } | |||
| @@ -1460,9 +1481,14 @@ espeak_ERROR SetVoiceByName(const char *name) | |||
| if((v = SelectVoiceByName(voices_list,buf)) != NULL) | |||
| { | |||
| if(LoadVoiceVariant(v->identifier,variant) != NULL) | |||
| if(LoadVoice(v->identifier,0) != NULL) | |||
| { | |||
| voice_selected = v; | |||
| if(variant_name[0] != 0) | |||
| { | |||
| LoadVoice(variant_name,2); | |||
| } | |||
| WavegenSetVoice(voice); | |||
| SetVoiceStack(&voice_selector); | |||
| return(EE_OK); | |||
| @@ -30,10 +30,10 @@ | |||
| #include "speak_lib.h" | |||
| #include "main.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #include "spect.h" | |||
| #include "translate.h" | |||
| #include "options.h" | |||
| @@ -30,9 +30,9 @@ | |||
| #include "speak_lib.h" | |||
| #include "speech.h" | |||
| #include "voice.h" | |||
| #include "phoneme.h" | |||
| #include "synthesize.h" | |||
| #include "voice.h" | |||
| #ifdef USE_PORTAUDIO | |||
| #include "portaudio.h" | |||
| @@ -380,6 +380,7 @@ LINK32=link.exe | |||
| # PROP Use_Debug_Libraries 1 | |||
| # PROP Output_Dir "vc_mswud" | |||
| # PROP Intermediate_Dir "vc_mswud\minimal" | |||
| # PROP Ignore_Export_Lib 0 | |||
| # PROP Target_Dir "" | |||
| # ADD BASE CPP /nologo /MDd /W4 /Gm /GR /Zi /Od /I ".\..\..\lib\vc_lib\mswud" /I ".\..\..\include" /I "." /I ".\..\..\samples" /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /D "_WINDOWS" /D "NOPCH" /Fd"vc_mswud\minimal.pdb" /FD /GZ /EHsc /c | |||
| # ADD CPP /nologo /MDd /W4 /Gm /GR /Zi /Od /I ".\..\..\lib\vc_lib\mswud" /I ".\..\..\include" /I "." /I ".\..\..\samples" /D "WIN32" /D "_DEBUG" /D "__WXMSW__" /D "__WXDEBUG__" /D "_UNICODE" /D "_WINDOWS" /D "NOPCH" /Fd"vc_mswud\minimal.pdb" /FD /GZ /EHsc /c | |||
| @@ -392,7 +393,7 @@ BSC32=bscmake.exe | |||
| # ADD BSC32 /nologo | |||
| LINK32=link.exe | |||
| # ADD BASE LINK32 wxmsw28ud_core.lib wxbase28ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /subsystem:windows /debug /machine:I386 /libpath:".\..\..\lib\vc_lib" | |||
| # ADD LINK32 wxmsw28ud_core.lib wxbase28ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /subsystem:windows /debug /machine:I386 /libpath:".\..\..\lib\vc_lib" | |||
| # ADD LINK32 wxmsw28ud_core.lib wxbase28ud.lib wxmsw28ud_adv.lib winmm.lib PAStaticWMME.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib PAStaticWMME.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib /nologo /subsystem:windows /debug /machine:I386 /libpath:".\..\..\lib\vc_lib" | |||
| !ELSEIF "$(CFG)" == "minimal - Win32 Release" | |||
| @@ -21,8 +21,6 @@ | |||
| #define LOG_FRAMES // write keyframe info to src/log | |||
| #define N_PEAKS 9 | |||
| #define N_MARKERS 8 | |||
| // comment this out when compiling the "speak" process | |||
| //#define SPECT_EDITOR | |||
| @@ -43,6 +41,9 @@ typedef unsigned short USHORT; | |||
| typedef unsigned char UCHAR; | |||
| typedef double DOUBLEX; | |||
| typedef struct { | |||
| const char *mnem; | |||
| int value; | |||
| @@ -50,31 +51,12 @@ typedef struct { | |||
| int LookupMnem(MNEM_TAB *table, char *string); | |||
| typedef struct { | |||
| short pkfreq; | |||
| short pkheight; | |||
| short pkwidth; | |||
| short pkright; | |||
| } peak_t; | |||
| typedef struct { | |||
| short frflags; | |||
| unsigned char length; | |||
| unsigned char rms; | |||
| short ffreq[9]; | |||
| unsigned char fheight[9]; | |||
| unsigned char fwidth[6]; // width/4 | |||
| unsigned char fright[6]; // width/4 | |||
| } frame_t; | |||
| #define N_PATH_HOME 120 | |||
| extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
| extern void strncpy0(char *to,const char *from, int size); | |||
| int GetFileLength(const char *filename); | |||
| char *Alloc(int size); | |||
| void Free(void *ptr); | |||
| #define N_PATH_HOME 120 | |||
| extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
| extern const char *version_string; | |||
| extern const int version_phdata; | |||
| extern void strncpy0(char *to,const char *from, int size); | |||
| @@ -21,8 +21,6 @@ | |||
| #define LOG_FRAMES // write keyframe info to src/log | |||
| #define N_PEAKS 9 | |||
| #define N_MARKERS 8 | |||
| // comment this out when compiling the "speak" process | |||
| //#define SPECT_EDITOR | |||
| @@ -43,6 +41,9 @@ typedef unsigned short USHORT; | |||
| typedef unsigned char UCHAR; | |||
| typedef double DOUBLEX; | |||
| typedef struct { | |||
| const char *mnem; | |||
| int value; | |||
| @@ -50,31 +51,12 @@ typedef struct { | |||
| int LookupMnem(MNEM_TAB *table, char *string); | |||
| typedef struct { | |||
| short pkfreq; | |||
| short pkheight; | |||
| short pkwidth; | |||
| short pkright; | |||
| } peak_t; | |||
| typedef struct { | |||
| short frflags; | |||
| unsigned char length; | |||
| unsigned char rms; | |||
| short ffreq[9]; | |||
| unsigned char fheight[9]; | |||
| unsigned char fwidth[6]; // width/4 | |||
| unsigned char fright[6]; // width/4 | |||
| } frame_t; | |||
| #define N_PATH_HOME 120 | |||
| extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
| extern void strncpy0(char *to,const char *from, int size); | |||
| int GetFileLength(const char *filename); | |||
| char *Alloc(int size); | |||
| void Free(void *ptr); | |||
| #define N_PATH_HOME 120 | |||
| extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
| extern const char *version_string; | |||
| extern const int version_phdata; | |||
| extern void strncpy0(char *to,const char *from, int size); | |||
| @@ -41,9 +41,6 @@ typedef double DOUBLEX; | |||
| #define N_PEAKS 9 | |||
| #define N_MARKERS 7 | |||
| typedef struct { | |||
| const char *mnem; | |||
| @@ -52,33 +49,12 @@ typedef struct { | |||
| int LookupMnem(MNEM_TAB *table, char *string); | |||
| typedef struct { | |||
| short pkfreq; | |||
| short pkheight; | |||
| short pkwidth; | |||
| short pkright; | |||
| } peak_t; | |||
| typedef struct { | |||
| short frflags; | |||
| unsigned char length; | |||
| unsigned char rms; | |||
| short ffreq[9]; | |||
| unsigned char fheight[9]; | |||
| unsigned char fwidth[6]; // width/4 | |||
| unsigned char fright[6]; // width/4 | |||
| } frame_t; | |||
| int GetFileLength(const char *filename); | |||
| char *Alloc(int size); | |||
| void Free(void *ptr); | |||
| #define N_PATH_HOME 120 | |||
| extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
| extern const char *version_string; | |||
| extern const int version_phdata; | |||
| extern void strncpy0(char *to,const char *from, int size); | |||
| int GetFileLength(const char *filename); | |||
| char *Alloc(int size); | |||
| void Free(void *ptr); | |||
| @@ -42,9 +42,6 @@ typedef double DOUBLEX; | |||
| #define N_PEAKS 9 | |||
| #define N_MARKERS 7 | |||
| typedef struct { | |||
| const char *mnem; | |||
| @@ -53,33 +50,12 @@ typedef struct { | |||
| int LookupMnem(MNEM_TAB *table, char *string); | |||
| typedef struct { | |||
| short pkfreq; | |||
| short pkheight; | |||
| short pkwidth; | |||
| short pkright; | |||
| } peak_t; | |||
| typedef struct { | |||
| short frflags; | |||
| unsigned char length; | |||
| unsigned char rms; | |||
| short ffreq[9]; | |||
| unsigned char fheight[9]; | |||
| unsigned char fwidth[6]; // width/4 | |||
| unsigned char fright[6]; // width/4 | |||
| } frame_t; | |||
| int GetFileLength(const char *filename); | |||
| char *Alloc(int size); | |||
| void Free(void *ptr); | |||
| #define N_PATH_HOME 120 | |||
| extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
| extern const char *version_string; | |||
| extern const int version_phdata; | |||
| extern void strncpy0(char *to,const char *from, int size); | |||
| int GetFileLength(const char *filename); | |||
| char *Alloc(int size); | |||
| void Free(void *ptr); | |||
| @@ -46,9 +46,6 @@ typedef double DOUBLEX; | |||
| #define N_PEAKS 9 | |||
| #define N_MARKERS 7 | |||
| typedef struct { | |||
| const char *mnem; | |||
| @@ -57,33 +54,12 @@ typedef struct { | |||
| int LookupMnem(MNEM_TAB *table, char *string); | |||
| typedef struct { | |||
| short pkfreq; | |||
| short pkheight; | |||
| short pkwidth; | |||
| short pkright; | |||
| } peak_t; | |||
| typedef struct { | |||
| short frflags; | |||
| unsigned char length; | |||
| unsigned char rms; | |||
| short ffreq[9]; | |||
| unsigned char fheight[9]; | |||
| unsigned char fwidth[6]; // width/4 | |||
| unsigned char fright[6]; // width/4 | |||
| } frame_t; | |||
| int GetFileLength(const char *filename); | |||
| char *Alloc(int size); | |||
| void Free(void *ptr); | |||
| #define N_PATH_HOME 120 | |||
| extern char path_home[N_PATH_HOME]; // this is the espeak-data directory | |||
| extern const char *version_string; | |||
| extern const int version_phdata; | |||
| extern void strncpy0(char *to,const char *from, int size); | |||
| int GetFileLength(const char *filename); | |||
| char *Alloc(int size); | |||
| void Free(void *ptr); | |||