diff options
-rw-r--r-- | engines/sci/sci.cpp | 1 | ||||
-rw-r--r-- | engines/sci/sound/audio32.cpp | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 09adf73d3b..f44bed6817 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -160,6 +160,7 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc, SciGameId gam SearchMan.addSubDirectoryMatching(gameDataDir, "Sound Folder"); // Mac audio files SearchMan.addSubDirectoryMatching(gameDataDir, "Voices Folder", 0, 2, true); // Mac audio36 files (recursive for Torin) SearchMan.addSubDirectoryMatching(gameDataDir, "Voices"); // Mac audio36 files + SearchMan.addSubDirectoryMatching(gameDataDir, "Voices/AUD#"); // LSL6 Mac audio36 files SearchMan.addSubDirectoryMatching(gameDataDir, "VMD Folder"); // Mac VMD files // Add the patches directory, except for KQ6CD; The patches folder in some versions of KQ6CD diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp index 9bf08c5f74..0f08e803fb 100644 --- a/engines/sci/sound/audio32.cpp +++ b/engines/sci/sound/audio32.cpp @@ -22,6 +22,7 @@ #include "sci/sound/audio32.h" #include "audio/audiostream.h" // for SeekableAudioStream +#include "audio/decoders/aiff.h" // for makeAIFFStream #include "audio/decoders/mac_snd.h" // for makeMacSndStream #include "audio/decoders/raw.h" // for makeRawStream, RawFlags::FLAG_16BITS #include "audio/decoders/wave.h" // for makeWAVStream @@ -84,6 +85,25 @@ bool detectWaveAudio(Common::SeekableReadStream &stream) { return true; } +bool detectAIFFAudio(Common::SeekableReadStream &stream) { + const size_t initialPosition = stream.pos(); + + byte blockHeader[8]; + if (stream.read(blockHeader, sizeof(blockHeader)) != sizeof(blockHeader)) { + stream.seek(initialPosition); + return false; + } + + stream.seek(initialPosition); + const uint32 headerType = READ_BE_UINT32(blockHeader); + + if (headerType != MKTAG('F', 'O', 'R', 'M')) { + return false; + } + + return true; +} + bool detectMacSndAudio(Common::SeekableReadStream &stream) { const size_t initialPosition = stream.pos(); @@ -811,6 +831,8 @@ uint16 Audio32::play(int16 channelIndex, const ResourceId resourceId, const bool audioStream = makeSOLStream(dataStream, DisposeAfterUse::YES); } else if (detectWaveAudio(*dataStream)) { audioStream = Audio::makeWAVStream(dataStream, DisposeAfterUse::YES); + } else if (detectAIFFAudio(*dataStream)) { + audioStream = Audio::makeAIFFStream(dataStream, DisposeAfterUse::YES); } else if (detectMacSndAudio(*dataStream)) { audioStream = Audio::makeMacSndStream(dataStream, DisposeAfterUse::YES); } else { |