diff options
author | Max Horn | 2010-01-19 11:21:25 +0000 |
---|---|---|
committer | Max Horn | 2010-01-19 11:21:25 +0000 |
commit | d2dd5a569a4033a46b2e5cd99b0dc71897c8d9bc (patch) | |
tree | db53ee8a59316145b791ec53fea6c691e226281a | |
parent | b227c660c6f0491a409a35bbb317f8558258e338 (diff) | |
download | scummvm-rg350-d2dd5a569a4033a46b2e5cd99b0dc71897c8d9bc.tar.gz scummvm-rg350-d2dd5a569a4033a46b2e5cd99b0dc71897c8d9bc.tar.bz2 scummvm-rg350-d2dd5a569a4033a46b2e5cd99b0dc71897c8d9bc.zip |
SAGA: Move from Mixer::playRaw to playInputStream; add FIXME regarding sounds not being looped
svn-id: r47376
-rw-r--r-- | engines/saga/sound.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp index e8307699ff..90698690ea 100644 --- a/engines/saga/sound.cpp +++ b/engines/saga/sound.cpp @@ -66,6 +66,8 @@ SndHandle *Sound::getHandle() { void Sound::playSoundBuffer(Audio::SoundHandle *handle, SoundBuffer &buffer, int volume, sndHandleType handleType, bool loop) { + Audio::AudioStream *stream = 0; + if (loop) buffer.flags |= Audio::Mixer::FLAG_LOOP; @@ -73,11 +75,11 @@ void Sound::playSoundBuffer(Audio::SoundHandle *handle, SoundBuffer &buffer, int Audio::Mixer::kSpeechSoundType : Audio::Mixer::kSFXSoundType; if (!buffer.isCompressed) { - _mixer->playRaw(soundType, handle, buffer.buffer, - buffer.size, DisposeAfterUse::YES, buffer.frequency, buffer.flags, -1, volume); + stream = Audio::makeRawMemoryStream(buffer.buffer, buffer.size, DisposeAfterUse::YES, buffer.frequency, buffer.flags, 0, 0); } else { - Audio::AudioStream *stream = 0; + // TODO / FIXME: It seems we don't loop compressed audio at all, but do loop uncompressed data. + // Is that intentional? Seems odd... switch (buffer.soundType) { #ifdef USE_MAD case kSoundMP3: @@ -99,10 +101,10 @@ void Sound::playSoundBuffer(Audio::SoundHandle *handle, SoundBuffer &buffer, int warning("Unknown compression, ignoring sound"); break; } - - if (stream != NULL) - _mixer->playInputStream(soundType, handle, stream, -1, volume, 0, DisposeAfterUse::YES, false); } + + if (stream != NULL) + _mixer->playInputStream(soundType, handle, stream, -1, volume); } void Sound::playSound(SoundBuffer &buffer, int volume, bool loop) { |