aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/tinsel/sound.cpp22
-rw-r--r--engines/tinsel/sound.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp
index 4876f91a3a..528a0c78f8 100644
--- a/engines/tinsel/sound.cpp
+++ b/engines/tinsel/sound.cpp
@@ -497,32 +497,32 @@ void SoundManager::openSampleFiles(void) {
// file must be corrupt if we get to here
error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage));
-#ifdef SCUMM_BIG_ENDIAN
- // Convert all ids from LE to native format
- for (uint i = 0; i < _sampleIndexLen / sizeof(uint32); ++i) {
- _sampleIndex[i] = READ_LE_UINT32(_sampleIndex + i);
- }
-#endif
-
// close the file
f.close();
// convert file size to size in DWORDs
_sampleIndexLen /= sizeof(uint32);
+#ifdef SCUMM_BIG_ENDIAN
+ // Convert all ids from LE to native format
+ for (int i = 0; i < _sampleIndexLen; ++i) {
+ _sampleIndex[i] = SWAP_BYTES_32(_sampleIndex[i]);
+ }
+#endif
+
// Detect format of soundfile by looking at 1st sample-index
- switch (_sampleIndex[0]) {
- case MKID_BE(' 3PM'):
+ switch (TO_BE_32(_sampleIndex[0])) {
+ case MKID_BE('MP3 '):
debugC(DEBUG_DETAILED, kTinselDebugSound, "Detected MP3 sound-data");
_soundMode = kMP3Mode;
break;
- case MKID_BE(' GGO'):
+ case MKID_BE('OGG '):
debugC(DEBUG_DETAILED, kTinselDebugSound, "Detected OGG sound-data");
_soundMode = kVorbisMode;
break;
- case MKID_BE('CALF'):
+ case MKID_BE('FLAC'):
debugC(DEBUG_DETAILED, kTinselDebugSound, "Detected FLAC sound-data");
_soundMode = kFlacMode;
break;
diff --git a/engines/tinsel/sound.h b/engines/tinsel/sound.h
index 9bdd037ff0..27682a4a21 100644
--- a/engines/tinsel/sound.h
+++ b/engines/tinsel/sound.h
@@ -92,7 +92,7 @@ protected:
uint32 *_sampleIndex;
/** Number of entries in the sample index */
- long _sampleIndexLen;
+ int _sampleIndexLen;
/** Specifies if the sample-data is compressed and if yes, how */
SoundMode _soundMode;