Ticket #2688: samplerate.diff
File samplerate.diff, 1.9 KB (added by , 17 years ago) |
---|
-
engines/sky/sound.h
83 83 Disk *_skyDisk; 84 84 uint16 _sfxBaseOfs; 85 85 uint8 *_soundData; 86 uint8 *_s fxInfo;86 uint8 *_sampleRates, *_sfxInfo; 87 87 uint8 _mainSfxVolume; 88 88 89 89 static uint16 _speechConvertTable[8]; -
engines/sky/sound.cpp
1070 1070 error("Unknown sounddriver version!"); 1071 1071 1072 1072 _soundsTotal = _soundData[asmOfs + 1]; 1073 uint16 sRateTabOfs = READ_LE_UINT16(_soundData + asmOfs + 0x29); 1073 1074 _sfxBaseOfs = READ_LE_UINT16(_soundData + asmOfs + 0x31); 1075 _sampleRates = _soundData + sRateTabOfs; 1074 1076 1075 1077 _sfxInfo = _soundData + _sfxBaseOfs; 1076 1078 // if we just restored a savegame, the sfxqueue holds the sound we need to restart … … 1100 1102 sound &= 0xFF; 1101 1103 1102 1104 // note: all those tables are big endian. Don't ask me why. *sigh* 1105 uint16 sampleRate = READ_BE_UINT16(_sampleRates + (sound << 2)); 1106 if (sampleRate > 11025) 1107 sampleRate = 11025; 1103 1108 uint32 dataOfs = READ_BE_UINT16(_sfxInfo + (sound << 3) + 0) << 4; 1104 1109 uint32 dataSize = READ_BE_UINT16(_sfxInfo + (sound << 3) + 2); 1105 1110 uint32 dataLoop = READ_BE_UINT16(_sfxInfo + (sound << 3) + 6); … … 1115 1120 } 1116 1121 1117 1122 if (channel == 0) 1118 _mixer->playRaw(&_ingameSound0, _soundData + dataOfs, dataSize, 11025, flags, SOUND_CH0, volume, 0, loopSta, loopEnd);1123 _mixer->playRaw(&_ingameSound0, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH0, volume, 0, loopSta, loopEnd); 1119 1124 else 1120 _mixer->playRaw(&_ingameSound1, _soundData + dataOfs, dataSize, 11025, flags, SOUND_CH1, volume, 0, loopSta, loopEnd);1125 _mixer->playRaw(&_ingameSound1, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH1, volume, 0, loopSta, loopEnd); 1121 1126 } 1122 1127 1123 1128 void Sound::fnStartFx(uint32 sound, uint8 channel) {