diff options
author | Torbjörn Andersson | 2015-09-16 22:09:08 +0200 |
---|---|---|
committer | Torbjörn Andersson | 2015-09-16 22:09:08 +0200 |
commit | d227e40e53f5458d2055fcb855557c448d405f6b (patch) | |
tree | 77c5164284d973a94905f1e12e88f7f1e729bd20 | |
parent | 1fdeb98e70d606c9e6c8a012d26062c1cd859524 (diff) | |
download | scummvm-rg350-d227e40e53f5458d2055fcb855557c448d405f6b.tar.gz scummvm-rg350-d227e40e53f5458d2055fcb855557c448d405f6b.tar.bz2 scummvm-rg350-d227e40e53f5458d2055fcb855557c448d405f6b.zip |
SHERLOCK: Play rain sound during 3DO Scalpel intro
This is based on guesswork, particularly with regards to the volume.
It sounds pretty close to a YouTube video I saw of the original game,
and at least it's not unpleasantly loud.
-rw-r--r-- | engines/sherlock/scalpel/scalpel.cpp | 9 | ||||
-rw-r--r-- | engines/sherlock/sound.cpp | 24 | ||||
-rw-r--r-- | engines/sherlock/sound.h | 11 |
3 files changed, 41 insertions, 3 deletions
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp index 086d6070c4..17e60f5365 100644 --- a/engines/sherlock/scalpel/scalpel.cpp +++ b/engines/sherlock/scalpel/scalpel.cpp @@ -690,15 +690,16 @@ bool ScalpelEngine::showCityCutscene3DO() { screen.clear(); bool finished = _events->delay(2500, true); - // rain.aiff seems to be playing in an endless loop until - // sherlock logo fades away TODO - if (finished) { finished = _events->delay(2500, true); // Play intro music _music->loadSong("prolog"); + // Loop rain.aiff until the Sherlock logo fades away. + // TODO: The volume is just a guess. + _sound->playAiff("prologue/sounds/rain.aiff", 15, true); + // Fade screen to grey screen._backBuffer1.fill(0xCE59); // RGB565: 25, 50, 25 (grey) screen.fadeIntoScreen3DO(2); @@ -763,6 +764,8 @@ bool ScalpelEngine::showCityCutscene3DO() { if (finished) finished = _music->waitUntilMSec(33600, 0, 0, 2000); + _sound->stopAiff(); + if (finished) { // Fade to black screen._backBuffer1.clear(); diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp index fd51462bc0..66b5b5bf5c 100644 --- a/engines/sherlock/sound.cpp +++ b/engines/sherlock/sound.cpp @@ -168,6 +168,30 @@ bool Sound::playSound(const Common::String &name, WaitType waitType, int priorit return retval; } +void Sound::playAiff(const Common::String &name, int volume, bool loop) { + Common::File *file = new Common::File(); + if (!file->open(name)) { + delete file; + return; + } + Audio::AudioStream *stream; + Audio::RewindableAudioStream *audioStream = Audio::makeAIFFStream(file, DisposeAfterUse::YES); + if (loop) { + Audio::AudioStream *loopingStream = Audio::makeLoopingAudioStream(audioStream, 0); + stream = loopingStream; + } else { + stream = audioStream; + } + stopAiff(); + _mixer->playStream(Audio::Mixer::kSFXSoundType, &_aiffHandle, stream, -1, volume); +} + +void Sound::stopAiff() { + if (_mixer->isSoundHandleActive(_aiffHandle)) { + _mixer->stopHandle(_aiffHandle); + } +} + void Sound::playLoadedSound(int bufNum, WaitType waitType) { if (IS_SERRATED_SCALPEL) { if (_mixer->isSoundHandleActive(_scalpelEffectsHandle) && (_curPriority > _vm->_scene->_sounds[bufNum]._priority)) diff --git a/engines/sherlock/sound.h b/engines/sherlock/sound.h index b2d1584e85..44969b8923 100644 --- a/engines/sherlock/sound.h +++ b/engines/sherlock/sound.h @@ -46,6 +46,7 @@ private: SherlockEngine *_vm; Audio::Mixer *_mixer; Audio::SoundHandle _scalpelEffectsHandle; + Audio::SoundHandle _aiffHandle; Audio::SoundHandle _tattooEffectsHandle[MAX_MIXER_CHANNELS]; Audio::SoundHandle _speechHandle; int _curPriority; @@ -87,6 +88,16 @@ public: * Play the sound in the specified resource */ bool playSound(const Common::String &name, WaitType waitType, int priority = 100, const char *libraryFilename = nullptr); + + /** + * Play the specified AIFF file. (Used for the 3DO Scalpel intro.) + */ + void playAiff(const Common::String &name, int volume = Audio::Mixer::kMaxChannelVolume, bool loop = false); + + /** + * Stop the AIFF sound that was started with playAiff(). + */ + void stopAiff(); /** * Play a previously loaded sound |