diff options
Diffstat (limited to 'engines/mortevielle')
-rw-r--r-- | engines/mortevielle/sound.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp index 95da5c0e01..d95b12da3c 100644 --- a/engines/mortevielle/sound.cpp +++ b/engines/mortevielle/sound.cpp @@ -187,10 +187,13 @@ void SoundManager::playNote(int frequency, int32 length) { void SoundManager::playSong(const byte* buf, int size) { Audio::AudioStream *stream = Audio::makeRawStream(buf, size, 11025 / 2, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_16BITS); - _mixer->playStream(Audio::Mixer::kSFXSoundType, &_speakerHandle, stream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO); + Audio::SoundHandle songHandle; + _mixer->playStream(Audio::Mixer::kSFXSoundType, &songHandle, stream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO); - while (_mixer->isSoundHandleActive(_speakerHandle) && !_vm->keyPressed() && !_vm->_mouseClick && !_vm->shouldQuit()) + while (_mixer->isSoundHandleActive(songHandle) && !_vm->keyPressed() && !_vm->_mouseClick && !_vm->shouldQuit()) ; + // In case the handle is still active, stop it. + _mixer->stopHandle(songHandle); } void SoundManager::setParent(MortevielleEngine *vm) { |