static int mbrola_control = 0; | static int mbrola_control = 0; | ||||
static int mbr_name_prefix = 0; | static int mbr_name_prefix = 0; | ||||
espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int srate) | espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int *srate) | ||||
{//=================================================================================== | {//=================================================================================== | ||||
// Load a phoneme name translation table from espeak-data/mbrola | // Load a phoneme name translation table from espeak-data/mbrola | ||||
fclose(f_in); | fclose(f_in); | ||||
setVolumeRatio_MBR((float)(mbrola_control & 0xff) /16.0f); | setVolumeRatio_MBR((float)(mbrola_control & 0xff) /16.0f); | ||||
// srate = getFreq_MBR(); | samplerate = *srate = getFreq_MBR(); | ||||
samplerate = srate; | if(*srate == 22050) | ||||
if(srate == 22050) | |||||
SetParameter(espeakVOICETYPE,0,0); | SetParameter(espeakVOICETYPE,0,0); | ||||
else | else | ||||
SetParameter(espeakVOICETYPE,1,0); | SetParameter(espeakVOICETYPE,1,0); |
espeak_ERROR SetVoiceByName(const char *name); | espeak_ERROR SetVoiceByName(const char *name); | ||||
espeak_ERROR SetVoiceByProperties(espeak_VOICE *voice_selector); | espeak_ERROR SetVoiceByProperties(espeak_VOICE *voice_selector); | ||||
espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int srate); | espeak_ERROR LoadMbrolaTable(const char *mbrola_voice, const char *phtrans, int *srate); | ||||
void SetParameter(int parameter, int value, int relative); | void SetParameter(int parameter, int value, int relative); | ||||
int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, int resume, FILE *f_mbrola); | int MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, int resume, FILE *f_mbrola); | ||||
int MbrolaGenerate(PHONEME_LIST *phoneme_list, int *n_ph, int resume); | int MbrolaGenerate(PHONEME_LIST *phoneme_list, int *n_ph, int resume); |
name2[0] = 0; | name2[0] = 0; | ||||
sscanf(p,"%s %s %d",name1,name2,&srate); | sscanf(p,"%s %s %d",name1,name2,&srate); | ||||
if(LoadMbrolaTable(name1,name2,srate) != EE_OK) | if(LoadMbrolaTable(name1,name2,&srate) != EE_OK) | ||||
{ | { | ||||
fprintf(stderr,"mbrola voice not found\n"); | fprintf(stderr,"mbrola voice not found\n"); | ||||
} | } |