add option to swap bytes in raw smp import

This commit is contained in:
tildearrow 2023-09-25 05:09:56 -05:00
parent 8231e3beba
commit a3d8c81e9d
2 changed files with 11 additions and 2 deletions

View file

@ -464,6 +464,13 @@ DivSample* DivEngine::sampleFromFileRaw(const char* path, DivSampleDepth depth,
accum/=channels;
sample->data8[i]=accum;
}
if (bigEndian) {
for (unsigned int i=0; (i+1)<samples; i+=2) {
sample->data8[i]^=sample->data8[i^1];
sample->data8[i^1]^=sample->data8[i];
sample->data8[i]^=sample->data8[i^1];
}
}
} else {
memcpy(sample->getCurBuf(),buf,len);
}