properly load unsigned 8-bit samples

This commit is contained in:
tildearrow 2021-12-20 16:33:10 -05:00
parent 548fa2ad73
commit 1234dcf2bc

View file

@ -1589,7 +1589,7 @@ bool DivEngine::addSampleFromFile(const char* path) {
averaged+=buf[i+j];
}
averaged/=si.channels;
sample->data[index++]=averaged;
sample->data[index++]=averaged^(((si.format&SF_FORMAT_SUBMASK)==SF_FORMAT_PCM_U8)?0x8000:0);
}
delete[] buf;
// 4000, 8000, 11025, 16000, 22050, 32000