mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
Merge pull request #1141
This commit is contained in:
@@ -68,6 +68,8 @@ static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ER
|
||||
fname = fname2;
|
||||
}
|
||||
|
||||
fname_temp[0] = 0;
|
||||
|
||||
f = NULL;
|
||||
if ((f = fopen(fname, "rb")) != NULL) {
|
||||
int ix;
|
||||
@@ -126,12 +128,14 @@ static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ER
|
||||
if (fread(p, 1, length, f) != length) {
|
||||
int error = errno;
|
||||
fclose(f);
|
||||
remove(fname_temp);
|
||||
if (fname_temp[0])
|
||||
remove(fname_temp);
|
||||
free(p);
|
||||
return create_file_error_context(context, error, fname);
|
||||
}
|
||||
fclose(f);
|
||||
remove(fname_temp);
|
||||
if (fname_temp[0])
|
||||
remove(fname_temp);
|
||||
|
||||
ip = (int *)(&p[40]);
|
||||
soundicon_tab[index].length = (*ip) / 2; // length in samples
|
||||
|
||||
Reference in New Issue
Block a user