diff options
-rw-r--r-- | engines/mortevielle/sound.cpp | 7 | ||||
-rw-r--r-- | engines/mortevielle/sound.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp index 042097f52c..bfdadaa048 100644 --- a/engines/mortevielle/sound.cpp +++ b/engines/mortevielle/sound.cpp @@ -185,10 +185,11 @@ void SoundManager::playNote(int frequency, int32 length) { } -void SoundManager::playSong(const byte* buf, int size, int loops) { - Audio::AudioStream *stream = Audio::makeLoopingAudioStream(Audio::makeRawStream(buf, size, 11025 / 2, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_16BITS), loops); +void SoundManager::playSong(const byte* buf, uint size, uint loops) { + Audio::SeekableAudioStream *raw = Audio::makeRawStream(buf, size, 11025 / 2, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_16BITS, DisposeAfterUse::NO); + Audio::AudioStream *stream = Audio::makeLoopingAudioStream(raw, loops); Audio::SoundHandle songHandle; - _mixer->playStream(Audio::Mixer::kSFXSoundType, &songHandle, stream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO); + _mixer->playStream(Audio::Mixer::kSFXSoundType, &songHandle, stream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::YES); while (_mixer->isSoundHandleActive(songHandle) && !_vm->keyPressed() && !_vm->_mouseClick && !_vm->shouldQuit()) ; diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h index ee6aaff4ad..1f9e0d9c4d 100644 --- a/engines/mortevielle/sound.h +++ b/engines/mortevielle/sound.h @@ -106,7 +106,7 @@ public: void playNote(int frequency, int32 length); int decodeMusic(const byte *PSrc, byte *PDest, int size); - void playSong(const byte *buf, int size, int loops = 1); + void playSong(const byte *buf, uint usize, uint loops); void litph(tablint &t, int typ, int tempo); }; |