From 405d7df1b617f5f5e8663ec4fbd64215544c4596 Mon Sep 17 00:00:00 2001 From: Daniel Brookman Date: Tue, 13 Oct 2020 17:23:28 -0400 Subject: [PATCH] Read correct bit for IT signed flag --- trackrip/tracker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trackrip/tracker.py b/trackrip/tracker.py index add0877..72e494c 100644 --- a/trackrip/tracker.py +++ b/trackrip/tracker.py @@ -267,7 +267,7 @@ def __init__(self, file): else: sample["data"] = self.decompress_it_sample(sample_data) # HACK: don't know why 8-bit samples are signed while 16-bit samples are unsigned - if sample["width"] == 1 or not sample["signed"]: + if sample["width"] == 1 or sample["signed"]: sample["data"] = pcm.signed_to_unsigned(sample["data"]) @staticmethod @@ -304,7 +304,7 @@ def decode_sample_header(header_bytes) -> dict: # skip default pan convert = int.from_bytes(header_bytes[46:47], "big") - sample["signed"] = bool(convert & 1) + sample["signed"] = bool(convert & 0) # length of sample is stored in no. of samples NOT no. of bytes sample["length"] = int.from_bytes(header_bytes[48:52], "little") * sample["width"]