diff options
-rw-r--r-- | engines/sci/sound/music.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 647f588d1e..5530952dcf 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -350,8 +350,27 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) { pSnd->time = ++_timeCounter; if (track) { + bool playSample; + + if (_soundVersion <= SCI_VERSION_0_LATE && !_useDigitalSFX) { + // For SCI0 the digital sample is present in the same track as the + // MIDI. If the user specifically requests not to use the digital + // samples, play the MIDI data instead. If the MIDI portion of the + // track is empty however, play the digital sample anyway. This is + // necessary for e.g. the "Where am I?" sample in the SQ3 intro. + playSample = false; + + if (track->channelCount == 2) { + SoundResource::Channel &chan = track->channels[0]; + if (chan.data.size() < 2 || chan.data[1] == SCI_MIDI_EOT) { + playSample = true; + } + } + } else + playSample = (track->digitalChannelNr != -1); + // Play digital sample - if (track->digitalChannelNr != -1) { + if (playSample) { const SciSpan<const byte> &channelData = track->channels[track->digitalChannelNr].data; delete pSnd->pStreamAud; byte flags = Audio::FLAG_UNSIGNED; |