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.
This commit is contained in:
Torbjörn Andersson 2015-09-16 22:09:08 +02:00
parent 1fdeb98e70
commit d227e40e53
3 changed files with 41 additions and 3 deletions

View file

@ -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();

View file

@ -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))

View file

@ -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;
@ -88,6 +89,16 @@ public:
*/
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
*/