Browse Source

Fix loading wav files on big-endian architectures

Fixes #1152
master
Samuel Thibault 3 years ago
parent
commit
2c524ec8df
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      src/libespeak-ng/soundicon.c

+ 2
- 3
src/libespeak-ng/soundicon.c View File

{ {
FILE *f; FILE *f;
char *p; char *p;
int *ip;
int length; int length;
char fname_temp[100]; char fname_temp[100];
char fname2[sizeof(path_home)+13+40]; char fname2[sizeof(path_home)+13+40];
if (fname_temp[0]) if (fname_temp[0])
remove(fname_temp); remove(fname_temp);


ip = (int *)(&p[40]);
soundicon_tab[index].length = (*ip) / 2; // length in samples
length = p[40] | (p[41] << 8) | (p[42] << 16) | (p[43] << 24);
soundicon_tab[index].length = length / 2; // length in samples
soundicon_tab[index].data = p; soundicon_tab[index].data = p;
return ENS_OK; return ENS_OK;
} }

Loading…
Cancel
Save