From a5e4eed30e3a237d220d2777b20b2a56729ec7e1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 17 Aug 2009 11:11:38 +0000 Subject: Ignore speech and sound effect samples with unknown compression, instead of trying to play them as raw sound. Some cleanup svn-id: r43467 --- engines/saga/sound.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp index 202ce918de..58dc96a785 100644 --- a/engines/saga/sound.cpp +++ b/engines/saga/sound.cpp @@ -84,12 +84,10 @@ void Sound::playSoundBuffer(Audio::SoundHandle *handle, SoundBuffer &buffer, int flags |= Audio::Mixer::FLAG_UNSIGNED; if (!buffer.isCompressed) { - if (handleType == kVoiceHandle) - _mixer->playRaw(Audio::Mixer::kSpeechSoundType, handle, buffer.buffer, - buffer.size, buffer.frequency, flags, -1, volume); - else - _mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer.buffer, - buffer.size, buffer.frequency, flags, -1, volume); + Audio::Mixer::SoundType soundType = (handleType == kVoiceHandle) ? + Audio::Mixer::kSpeechSoundType : Audio::Mixer::kSFXSoundType; + _mixer->playRaw(soundType, handle, buffer.buffer, + buffer.size, buffer.frequency, flags, -1, volume); } else { Audio::AudioStream *stream = 0; @@ -110,13 +108,8 @@ void Sound::playSoundBuffer(Audio::SoundHandle *handle, SoundBuffer &buffer, int break; #endif default: - // No compression, play it as raw sound - if (handleType == kVoiceHandle) - _mixer->playRaw(Audio::Mixer::kSpeechSoundType, handle, buffer.buffer, - buffer.size, buffer.frequency, flags, -1, volume); - else - _mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer.buffer, - buffer.size, buffer.frequency, flags, -1, volume); + // Unknown compression, ignore sample + warning("Unknown compression, ignoring sound"); break; } -- cgit v1.2.3