From 8f1d1836f3f8330b9aa26dcc14d87a3bde36b2d9 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Thu, 24 May 2018 17:22:15 +0100 Subject: MOHAWK: Fix decoding sounds with 16 bit samples --- engines/mohawk/sound.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engines/mohawk/sound.cpp') diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index c46594000d..7bd6c63539 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -158,11 +158,16 @@ Audio::RewindableAudioStream *makeMohawkWaveStream(Common::SeekableReadStream *s // The sound in the CD version of Riven is encoded in Intel DVI ADPCM // The sound in the DVD version of Riven is encoded in MPEG-2 Layer II or Intel DVI ADPCM if (dataChunk.encoding == kCodecRaw) { - byte flags = Audio::FLAG_UNSIGNED; + byte flags = 0; if (dataChunk.channels == 2) flags |= Audio::FLAG_STEREO; + if (dataChunk.bitsPerSample == 16) + flags |= Audio::FLAG_16BITS; + else + flags |= Audio::FLAG_UNSIGNED; + return Audio::makeRawStream(dataChunk.audioData, dataChunk.sampleRate, flags); } else if (dataChunk.encoding == kCodecADPCM) { uint32 blockAlign = dataChunk.channels * dataChunk.bitsPerSample / 8; -- cgit v1.2.3