diff options
Diffstat (limited to 'engines/teenagent/teenagent.cpp')
-rw-r--r-- | engines/teenagent/teenagent.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 83cb8e10b2..29eedd7c52 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -29,6 +29,7 @@ #include "common/system.h" #include "engines/advancedDetector.h" #include "sound/mixer.h" +#include "sound/raw.h" #include "graphics/cursorman.h" #include "graphics/thumbnail.h" #include "teenagent/console.h" @@ -893,11 +894,12 @@ void TeenAgentEngine::playSoundNow(byte id) { } uint size = in->size(); - char *data = new char[size]; + byte *data = (byte *)malloc(size); in->read(data, size); //debug(0, "playing %u samples...", size); - _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_soundHandle, data, size, DisposeAfterUse::YES, 11025, 0); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(data, size, DisposeAfterUse::YES, 11025, 0); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundHandle, stream); } |