diff options
author | Travis Howell | 2005-11-13 10:01:40 +0000 |
---|---|---|
committer | Travis Howell | 2005-11-13 10:01:40 +0000 |
commit | 4af7ef91e58d07d41af88f5451f39a80ab51347b (patch) | |
tree | d10428719a1520f5ceb6b18ed31c67da9e7761bf /simon | |
parent | 81a956eeb3c07c88ed42bbb60396492976cc3c52 (diff) | |
download | scummvm-rg350-4af7ef91e58d07d41af88f5451f39a80ab51347b.tar.gz scummvm-rg350-4af7ef91e58d07d41af88f5451f39a80ab51347b.tar.bz2 scummvm-rg350-4af7ef91e58d07d41af88f5451f39a80ab51347b.zip |
Fix sound looping regression in simon2 (Windows).
Sound flags were been reset.
svn-id: r19583
Diffstat (limited to 'simon')
-rw-r--r-- | simon/sound.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/simon/sound.cpp b/simon/sound.cpp index 22e4ea9bb5..6bc7c04375 100644 --- a/simon/sound.cpp +++ b/simon/sound.cpp @@ -126,13 +126,15 @@ void WavSound::playSound(uint sound, Audio::SoundHandle *handle, byte flags) { _file->seek(_offsets[sound], SEEK_SET); - // Try to load the WAVE data into an audio stream - AudioStream *stream = makeWAVStream(*_file); - if (!stream) { - error("playWav(%d): can't read WAVE header", sound); + byte wavFlags; + int size, rate; + if (!loadWAVFromStream(*_file, size, rate, wavFlags)) { + error("playSound: Not a valid WAV file"); } - _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, stream); + byte *buffer = (byte *)malloc(size); + _file->read(buffer, size); + _mixer->playRaw(handle, buffer, size, rate, flags | wavFlags); } void VocSound::playSound(uint sound, Audio::SoundHandle *handle, byte flags) { @@ -141,10 +143,10 @@ void VocSound::playSound(uint sound, Audio::SoundHandle *handle, byte flags) { _file->seek(_offsets[sound], SEEK_SET); - int size, samples_per_sec; - byte *buffer = loadVOCFromStream(*_file, size, samples_per_sec); + int size, rate; + byte *buffer = loadVOCFromStream(*_file, size, rate); - _mixer->playRaw(handle, buffer, size, samples_per_sec, flags | Audio::Mixer::FLAG_AUTOFREE); + _mixer->playRaw(handle, buffer, size, rate, flags | Audio::Mixer::FLAG_AUTOFREE); } void RawSound::playSound(uint sound, Audio::SoundHandle *handle, byte flags) { |