diff --git a/src/Sound/SoundManager.cpp b/src/Sound/SoundManager.cpp index 3d80c83..664287d 100644 --- a/src/Sound/SoundManager.cpp +++ b/src/Sound/SoundManager.cpp @@ -610,15 +610,29 @@ OSErr GetSoundHeaderOffset(SndListHandle sndHandle, long* offset) memstream sndStream((Ptr) *sndHandle, GetHandleSize((Handle) sndHandle)); Pomme::BigEndianIStream f(sndStream); - // Skip everything before sound commands - Expect(1, f.Read(), "'snd ' format"); - Expect(1, f.Read(), "'snd ' modifier count"); - Expect(5, f.Read(), "'snd ' sampledSynth"); - UInt32 initBits = f.Read(); + // Read header + SInt16 format = f.Read(); + switch (format) + { + case 1: // Standard 'snd ' resource + { + Expect(1, f.Read(), "'snd ' modifier count"); + Expect(5, f.Read(), "'snd ' sampledSynth"); + UInt32 initBits = f.Read(); + if (initBits & initMACE6) + TODOFATAL2("MACE-6 not supported yet"); + break; + } - if (initBits & initMACE6) - TODOFATAL2("MACE-6 not supported yet"); + case 2: // HyperCard sampled-sound format + f.Skip(2); // Skip reference count (for application use) + break; + default: + return badFormat; + } + + // Now read sound commands SInt16 nCmds = f.Read(); //LOG << nCmds << " commands\n"; for (; nCmds >= 1; nCmds--)