aboutsummaryrefslogtreecommitdiff
path: root/engines/sword2
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword2')
-rw-r--r--engines/sword2/sound.cpp16
1 files changed, 9 insertions, 7 deletions
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;
}