From 40f98f195faee28a201cffb40760ff050cc2a9e8 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Fri, 29 May 2015 18:52:43 -0500 Subject: [PATCH] Whoops - PCM samples are signed, not unsigned --- src/xenia/apu/audio_decoder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xenia/apu/audio_decoder.cc b/src/xenia/apu/audio_decoder.cc index 55571b140..af75372f0 100644 --- a/src/xenia/apu/audio_decoder.cc +++ b/src/xenia/apu/audio_decoder.cc @@ -205,7 +205,7 @@ int AudioDecoder::DecodePacket(uint8_t* output, size_t output_offset, size_t out fRawSample = std::min( 1.f, fRawSample); fRawSample = std::max(-1.f, fRawSample); - float fScaledSample = fRawSample * ((1 << bits_) - 1); + float fScaledSample = fRawSample * (1 << (bits_ - 1)); // Convert the sample and output it in big endian int sample = (int)fScaledSample;