diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sword1/music.cpp | 2 | ||||
-rw-r--r-- | engines/sword2/sound.cpp | 16 | ||||
-rw-r--r-- | engines/tinsel/sound.cpp | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp index a82384659c..783900c598 100644 --- a/engines/sword1/music.cpp +++ b/engines/sword1/music.cpp @@ -252,7 +252,7 @@ bool MusicHandle::playPSX(uint16 id, bool loop) { // not over file size if ((size != 0) && (size != 0xffffffff) && ((int32)(offset + size) <= _file.size())) { _file.seek(offset, SEEK_SET); - _audioSource = new Audio::VagStream(_file.readStream(size), loop); + _audioSource = Audio::makeLoopingAudioStream(new Audio::VagStream(_file.readStream(size)), loop ? 0 : 1); fadeUp(); } else { _audioSource = NULL; diff --git a/engines/sword2/sound.cpp b/engines/sword2/sound.cpp index 3128bfed20..3d468ebba3 100644 --- a/engines/sword2/sound.cpp +++ b/engines/sword2/sound.cpp @@ -331,17 +331,19 @@ int32 Sound::playFx(Audio::SoundHandle *handle, byte *data, uint32 len, uint8 vo return RDERR_FXALREADYOPEN; Common::MemoryReadStream *stream = new Common::MemoryReadStream(data, len); - Audio::AudioStream *input = 0; + Audio::RewindableAudioStream *input = 0; - if (Sword2Engine::isPsx()) { - input = new Audio::VagStream(stream, loop); - } else { - input = Audio::makeLoopingAudioStream(Audio::makeWAVStream(stream, true), loop ? 0 : 1); - } + if (Sword2Engine::isPsx()) + input = new Audio::VagStream(stream); + else + input = Audio::makeWAVStream(stream, true); assert(input); - _vm->_mixer->playInputStream(soundType, handle, input, -1, vol, pan, true, false, isReverseStereo()); + if (loop) + _vm->_mixer->playInputStreamLooping(soundType, handle, input, 0, -1, vol, pan, true, false, isReverseStereo()); + else + _vm->_mixer->playInputStream(soundType, handle, input, -1, vol, pan, true, false, isReverseStereo()); return RD_OK; } diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index ece054138a..5d7bcfad72 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -108,7 +108,7 @@ bool SoundManager::playSample(int id, Audio::Mixer::SoundType type, Audio::Sound if (TinselV1PSX) { // Read the stream and create a VAG Audio stream - Audio::AudioStream *vagStream = new Audio::VagStream(_sampleStream.readStream(sampleLen), false, 44100); + Audio::AudioStream *vagStream = new Audio::VagStream(_sampleStream.readStream(sampleLen), 44100); // FIXME: Should set this in a different place ;) _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, _vm->_config->_soundVolume); |