From 018ab2d404142c0fa9a6b43d2966cce62d0d46cf Mon Sep 17 00:00:00 2001 From: Iliyas Jorio Date: Wed, 23 Feb 2022 23:42:22 +0100 Subject: [PATCH] In extSH snd resources, interpret 8-bit samples as unsigned --- src/SoundFormats/SoundFormats.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/SoundFormats/SoundFormats.cpp b/src/SoundFormats/SoundFormats.cpp index fa9f1e4..ac5416c 100644 --- a/src/SoundFormats/SoundFormats.cpp +++ b/src/SoundFormats/SoundFormats.cpp @@ -204,14 +204,11 @@ void Pomme::Sound::GetSoundInfo(const Ptr sndhdr, SampledSoundInfo& info) info.isCompressed = false; info.bigEndian = true; - info.compressionType = 'twos'; // TODO: if 16-bit, should we use 'raw ' or 'NONE'/'twos'? + info.compressionType = info.codecBitDepth == 8 ? 'raw ' : 'twos'; // unsigned if 8-bit, signed if 16-bit! info.nChannels = header.extSH_nChannels; info.dataStart = sndhdr + f.Tell(); info.compressedLength = header.extSH_nChannels * info.nPackets * info.codecBitDepth / 8; info.decompressedLength = info.compressedLength; - - if (info.codecBitDepth == 8) - TODO2("should an 8-bit extSH be 'twos' or 'raw '?"); break; }