aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel/sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tinsel/sound.cpp')
-rw-r--r--engines/tinsel/sound.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp
index bb0e251b52..ce2ed51d09 100644
--- a/engines/tinsel/sound.cpp
+++ b/engines/tinsel/sound.cpp
@@ -132,25 +132,35 @@ bool SoundManager::playSample(int id, Audio::Mixer::SoundType type, Audio::Sound
//_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic);
_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, _vm->_config->_voiceVolume);
- Common::MemoryReadStream *compressedStream =
- new Common::MemoryReadStream(sampleBuf, sampleLen, DisposeAfterUse::YES);
Audio::AudioStream *sampleStream = 0;
// play it
switch (_soundMode) {
case kMP3Mode:
#ifdef USE_MAD
+ {
+ Common::MemoryReadStream *compressedStream =
+ new Common::MemoryReadStream(sampleBuf, sampleLen, DisposeAfterUse::YES);
sampleStream = Audio::makeMP3Stream(compressedStream, DisposeAfterUse::YES);
+ }
#endif
break;
case kVorbisMode:
#ifdef USE_VORBIS
+ {
+ Common::MemoryReadStream *compressedStream =
+ new Common::MemoryReadStream(sampleBuf, sampleLen, DisposeAfterUse::YES);
sampleStream = Audio::makeVorbisStream(compressedStream, DisposeAfterUse::YES);
+ }
#endif
break;
case kFLACMode:
#ifdef USE_FLAC
+ {
+ Common::MemoryReadStream *compressedStream =
+ new Common::MemoryReadStream(sampleBuf, sampleLen, DisposeAfterUse::YES);
sampleStream = Audio::makeFLACStream(compressedStream, DisposeAfterUse::YES);
+ }
#endif
break;
default: