aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/sword1/music.cpp3
-rw-r--r--engines/sword1/sound.cpp5
-rw-r--r--engines/sword2/music.cpp2
-rw-r--r--engines/sword2/sound.cpp2
-rw-r--r--engines/tinsel/sound.cpp2
5 files changed, 8 insertions, 6 deletions
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp
index a10e705656..4661b042af 100644
--- a/engines/sword1/music.cpp
+++ b/engines/sword1/music.cpp
@@ -33,6 +33,7 @@
#include "sword1/music.h"
#include "sound/mixer.h"
+#include "sound/audiostream.h"
#include "sound/decoders/aiff.h"
#include "sound/decoders/flac.h"
#include "sound/decoders/mp3.h"
@@ -137,7 +138,7 @@ bool MusicHandle::playPSX(uint16 id, bool loop) {
// not over file size
if ((size != 0) && (size != 0xffffffff) && ((int32)(offset + size) <= _file.size())) {
_file.seek(offset, SEEK_SET);
- _audioSource = Audio::makeLoopingAudioStream(new Audio::VagStream(_file.readStream(size)), loop ? 0 : 1);
+ _audioSource = Audio::makeLoopingAudioStream(Audio::makeVagStream(_file.readStream(size)), loop ? 0 : 1);
fadeUp();
} else {
_audioSource = NULL;
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index 43a5b25d76..a9fe37242b 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -36,6 +36,7 @@
#include "sword1/logic.h"
#include "sword1/sword1.h"
+#include "sound/audiostream.h"
#include "sound/decoders/flac.h"
#include "sound/decoders/mp3.h"
#include "sound/decoders/raw.h"
@@ -259,7 +260,7 @@ void Sound::playSample(QueueElement *elem) {
if (SwordEngine::isPsx()) {
uint32 size = READ_LE_UINT32(sampleData);
- Audio::AudioStream *audStream = Audio::makeLoopingAudioStream(new Audio::VagStream(new Common::MemoryReadStream(sampleData + 4, size-4)), (_fxList[elem->id].type == FX_LOOP) ? 0 : 1);
+ Audio::AudioStream *audStream = Audio::makeLoopingAudioStream(Audio::makeVagStream(new Common::MemoryReadStream(sampleData + 4, size-4)), (_fxList[elem->id].type == FX_LOOP) ? 0 : 1);
_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &elem->handle, audStream, elem->id, volume, pan);
} else {
uint32 size = READ_LE_UINT32(sampleData + 0x28);
@@ -367,7 +368,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
_cowFile.seek(index * 2048);
Common::MemoryReadStream *tmp = _cowFile.readStream(sampleSize);
assert(tmp);
- stream = new Audio::VagStream(tmp);
+ stream = Audio::makeVagStream(tmp);
_mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, stream, SOUND_SPEECH_ID, speechVol, speechPan);
// with compressed audio, we can't calculate the wave volume.
// so default to talking.
diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp
index a7d5bf50c2..11dda11470 100644
--- a/engines/sword2/music.cpp
+++ b/engines/sword2/music.cpp
@@ -302,7 +302,7 @@ Audio::AudioStream *makePSXCLUStream(Common::File *file, int size) {
byte *buffer = (byte *)malloc(size);
file->read(buffer, size);
- return new Audio::VagStream(new Common::MemoryReadStream(buffer, size, DisposeAfterUse::YES));
+ return Audio::makeVagStream(new Common::MemoryReadStream(buffer, size, DisposeAfterUse::YES));
}
// ----------------------------------------------------------------------------
diff --git a/engines/sword2/sound.cpp b/engines/sword2/sound.cpp
index 5de38fde9c..4273da67b8 100644
--- a/engines/sword2/sound.cpp
+++ b/engines/sword2/sound.cpp
@@ -334,7 +334,7 @@ int32 Sound::playFx(Audio::SoundHandle *handle, byte *data, uint32 len, uint8 vo
Audio::RewindableAudioStream *input = 0;
if (Sword2Engine::isPsx())
- input = new Audio::VagStream(stream);
+ input = Audio::makeVagStream(stream);
else
input = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp
index ccb978f45e..379f1f2bb0 100644
--- a/engines/tinsel/sound.cpp
+++ b/engines/tinsel/sound.cpp
@@ -109,7 +109,7 @@ bool SoundManager::playSample(int id, Audio::Mixer::SoundType type, Audio::Sound
if (TinselV1PSX) {
// Read the stream and create a VAG Audio stream
- Audio::AudioStream *vagStream = new Audio::VagStream(_sampleStream.readStream(sampleLen), 44100);
+ Audio::AudioStream *vagStream = Audio::makeVagStream(_sampleStream.readStream(sampleLen), 44100);
// FIXME: Should set this in a different place ;)
_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, _vm->_config->_soundVolume);