Browse Source

Don't check if the MBROLA voice data is present on Windows.

With the original eSpeak Windows port, the MBROLA voices had to
be present in an mbrola folder of the espeak-data. This will be
different in espeak-ng, allowing the MBROLA voice files to be
located elsewhere on the system.
master
Reece H. Dunn 8 years ago
parent
commit
022e4e82dd
1 changed files with 3 additions and 18 deletions
  1. 3
    18
      src/libespeak-ng/voices.c

+ 3
- 18
src/libespeak-ng/voices.c View File

&tone_pts[8], &tone_pts[9]); &tone_pts[8], &tone_pts[9]);
} }


static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname, const char *leafname)
static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname)
{ {
(void)leafname; // unused (except for PLATFORM_WINDOWS)

// Read a Voice file, allocate a VOICE_DATA and set data from the // Read a Voice file, allocate a VOICE_DATA and set data from the
// file's language, gender, name lines // file's language, gender, name lines


int n_variants = 4; // default, number of variants of this voice before using another voice int n_variants = 4; // default, number of variants of this voice before using another voice
int gender; int gender;


#ifdef PLATFORM_WINDOWS
char fname_buf[sizeof(path_home)+15];
if (memcmp(leafname, "mb-", 3) == 0) {
// check whether the mbrola speech data is present for this voice
memcpy(vname, &leafname[3], 3);
vname[3] = 0;
sprintf(fname_buf, "%s/mbrola/%s", path_home, vname);

if (GetFileLength(fname_buf) <= 0)
return 0;
}
#endif

vname[0] = 0; vname[0] = 0;
vgender[0] = 0; vgender[0] = 0;
age = 0; age = 0;
continue; continue;


// pass voice file name within the voices directory // pass voice file name within the voices directory
voice_data = ReadVoiceFile(f_voice, fname+len_path_voices, FindFileData.cFileName);
voice_data = ReadVoiceFile(f_voice, fname+len_path_voices);
fclose(f_voice); fclose(f_voice);


if (voice_data != NULL) if (voice_data != NULL)
continue; continue;


// pass voice file name within the voices directory // pass voice file name within the voices directory
voice_data = ReadVoiceFile(f_voice, fname+len_path_voices, ent->d_name);
voice_data = ReadVoiceFile(f_voice, fname+len_path_voices);
fclose(f_voice); fclose(f_voice);


if (voice_data != NULL) if (voice_data != NULL)

Loading…
Cancel
Save