7
mirror of https://github.com/EEVengers/ThunderScope.git synced 2025-04-22 17:43:44 +00:00

convert signed bytes to unsigned bytes since 8-bit wav files are unsigned

This commit is contained in:
profezzorn 2022-02-06 22:12:21 -08:00
parent ff6df7e2ea
commit dd17422182

View File

@ -269,6 +269,10 @@ int main(int argc, char** argv) {
fprintf(stderr, "Thunderscope read error, error = %s\n", thunderscopehw_describe_error(ret));
exit(1);
}
// Convert signed output to unsigned output
for (size_t i = 0; i < BUFFER_SIZE; i++) {
buffer[i] += 0x80;
}
if (fwrite(buffer, 1, to_copy, outfile) != to_copy) {
perror("fwrite");
exit(1);