MOHAWK: Fix decoding sounds with 16 bit samples

This commit is contained in:
Cameron Cawley 2018-05-24 17:22:15 +01:00
parent cee4d6b853
commit 8f1d1836f3

View File

@ -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;