Browse Source

Take the mbrola voice sample rate from the mbrola wav file.

master
Reece H. Dunn 9 years ago
parent
commit
c885d1543e
3 changed files with 5 additions and 6 deletions
  1. 3
    4
      src/synth_mbrola.cpp
  2. 1
    1
      src/synthesize.h
  3. 1
    1
      src/voices.cpp

+ 3
- 4
src/synth_mbrola.cpp View File

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);

+ 1
- 1
src/synthesize.h View File



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);

+ 1
- 1
src/voices.cpp View File



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");
} }

Loading…
Cancel
Save