fix loading 8-bit samples

This commit is contained in:
tildearrow 2022-06-16 22:10:57 -05:00
parent 327952f3f4
commit cdbcf7fcd3

View file

@ -2234,7 +2234,7 @@ int DivEngine::addSampleFromFile(const char* path) {
for (int i=0; i<si.frames*si.channels; i+=si.channels) {
int averaged=0;
for (int j=0; j<si.channels; j++) {
averaged+=((unsigned char*)buf)[i+j];
averaged+=((int)((unsigned char*)buf)[i+j])-128;
}
averaged/=si.channels;
sample->data8[index++]=averaged;