mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-12 16:58:52 +00:00
[1.29.07] Set correct 22050Hz rate for mbrola voices de5,de6,de7
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@86 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+1
-1
@@ -590,7 +590,7 @@ void Translator::MakePhonemeList(int post_pause, int start_sentence)
|
||||
phlist[ix].length = 0;
|
||||
phlist[ix].sourceix=0;
|
||||
phlist[ix].synthflags = 0;
|
||||
phlist[ix++].ph = phoneme_tab[phonPAUSE_VSHORT];
|
||||
phlist[ix++].ph = phoneme_tab[phonPAUSE_SHORT];
|
||||
|
||||
n_phoneme_list = ix;
|
||||
} // end of MakePhonemeList
|
||||
|
||||
@@ -110,8 +110,8 @@ int mbrola_control = 0;
|
||||
|
||||
|
||||
|
||||
espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans)
|
||||
{//========================================================================
|
||||
espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int srate)
|
||||
{//===================================================================================
|
||||
// Load a phoneme name translation table from espeak-data/mbrola
|
||||
|
||||
int size;
|
||||
@@ -137,7 +137,7 @@ espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans)
|
||||
|
||||
setNoError_MBR(1); // don't stop on phoneme errors
|
||||
#else
|
||||
mb_handle = mbrolib_init( 22050 );
|
||||
mb_handle = mbrolib_init(srate);
|
||||
mbrolib_parameter m_parameters;
|
||||
|
||||
if(mb_handle == NULL)
|
||||
@@ -176,11 +176,14 @@ espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans)
|
||||
#endif // USE_MBROLA_LIB
|
||||
|
||||
option_quiet = 1;
|
||||
samplerate = 16000;
|
||||
samplerate = srate;
|
||||
if(srate == 22050)
|
||||
SetParameter(espeakVOICETYPE,0,0);
|
||||
else
|
||||
SetParameter(espeakVOICETYPE,1,0);
|
||||
strcpy(mbrola_name,mbrola_voice);
|
||||
SetParameter(espeakVOICETYPE,1,0);
|
||||
return(EE_OK);
|
||||
}
|
||||
} // end of LoadMbrolaTable
|
||||
|
||||
|
||||
int GetMbrName(PHONEME_LIST *plist, PHONEME_TAB *ph, PHONEME_TAB *ph_prev, PHONEME_TAB *ph_next, int *name2, int *split, int *control)
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.29.06 11.Sep.07";
|
||||
const char *version_string = "1.29.07 17.Sep.07";
|
||||
const int version_phdata = 0x012901;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
+1
-1
@@ -268,7 +268,7 @@ extern SOUND_ICON soundicon_tab[N_SOUNDICON_TAB];
|
||||
|
||||
espeak_ERROR SetVoiceByName(const char *name);
|
||||
espeak_ERROR SetVoiceByProperties(espeak_VOICE *voice_selector);
|
||||
espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans);
|
||||
espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int srate);
|
||||
void SetParameter(int parameter, int value, int relative);
|
||||
void MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, FILE *f_mbrola);
|
||||
int MbrolaSynth(char *p_mbrola);
|
||||
|
||||
+5
-3
@@ -386,7 +386,7 @@ SetToneAdjust(voice,tone_points);
|
||||
n_replace_phonemes = 0;
|
||||
option_tone1 = 0;
|
||||
option_quiet = 0;
|
||||
LoadMbrolaTable(NULL,NULL);
|
||||
LoadMbrolaTable(NULL,NULL,0);
|
||||
}
|
||||
} // end of VoiceReset
|
||||
|
||||
@@ -817,11 +817,13 @@ voice_t *LoadVoice(const char *vname, int control)
|
||||
|
||||
case V_MBROLA:
|
||||
{
|
||||
int srate = 16000;
|
||||
char name[40];
|
||||
char phtrans[40];
|
||||
|
||||
phtrans[0] = 0;
|
||||
sscanf(p,"%s %s",name,phtrans);
|
||||
LoadMbrolaTable(name,phtrans);
|
||||
sscanf(p,"%s %s %d",name,phtrans,&srate);
|
||||
LoadMbrolaTable(name,phtrans,srate);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user