diff --git a/insane.cpp b/insane.cpp index c9f2a8033b0..42601c04582 100644 --- a/insane.cpp +++ b/insane.cpp @@ -198,17 +198,23 @@ void SmushPlayer::parseIACT() { error("trk %d: no FRMT section"); _imusCodec[idx] = READ_BE_UINT32(_cur + pos + 16); _imusRate[idx] = READ_BE_UINT32(_cur + pos + 20); + _imusChan[idx] = READ_BE_UINT32(_cur + pos + 24); _imusPos[idx] = 0; break; case 'DATA' : switch (_imusCodec[idx]) { case 8 : + if (_imusChan[idx] == 2) + flags |= SoundMixer::FLAG_STEREO; flags |= SoundMixer::FLAG_UNSIGNED; buf = (byte *) malloc(sublen); memcpy(buf, _cur + pos, sublen); bpos = sublen; break; case 12 : + if (_imusChan[idx] == 2) + flags |= SoundMixer::FLAG_STEREO; + flags |= SoundMixer::FLAG_16BITS; buf = (byte *) malloc(2 * sublen); bpos = 0; @@ -229,15 +235,15 @@ void SmushPlayer::parseIACT() { temp = (temp | _imusData[idx][0]) << 4; temp -= 0x8000; - //buf[bpos++] = temp & 0xff; buf[bpos++] = (temp >> 8) & 0xff; + buf[bpos++] = temp & 0xff; temp = (_imusData[idx][1] & 0xf0) << 4; temp = (temp | _imusData[idx][2]) << 4; temp -= 0x8000; - //buf[bpos++] = temp & 0xff; buf[bpos++] = (temp >> 8) & 0xff; + buf[bpos++] = temp & 0xff; _imusPos[idx] = 0; } } diff --git a/smush.h b/smush.h index 42233cd34cb..8eeea152b66 100644 --- a/smush.h +++ b/smush.h @@ -72,7 +72,7 @@ struct SmushPlayer { /* IACT: The Dig audio */ uint32 _imusSize[8], _imusSubSize[8]; - uint32 _imusTrk[8], _imusRate[8]; + uint32 _imusTrk[8], _imusRate[8], _imusChan[8]; uint32 _imusSubTag[8]; byte _imusData[8][3]; uint32 _imusPos[8], _imusCodec[8];