aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/music.cpp4
-rw-r--r--engines/sword1/sound.cpp12
2 files changed, 13 insertions, 3 deletions
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp
index ebff7f9929..e6acd8f3cd 100644
--- a/engines/sword1/music.cpp
+++ b/engines/sword1/music.cpp
@@ -203,6 +203,10 @@ bool MusicHandle::play(const char *fileBase, bool loop) {
char fileName[30];
stop();
+ // FIXME: How about using AudioStream::openStreamFile instead of the code below?
+ // I.e.:
+ //_audioSource = Audio::AudioStream::openStreamFile(fileBase, 0, 0, loop ? 0 : 1);
+
#ifdef USE_FLAC
if (!_audioSource) {
sprintf(fileName, "%s.flac", fileBase);
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index 492672fad8..2594aaf8f4 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -201,7 +201,9 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
#ifdef USE_FLAC
else if (_cowMode == CowFlac) {
_cowFile.seek(index);
- _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, Audio::makeFlacStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
+ Common::MemoryReadStream *tmp = _cowFile.readStream(sampleSize);
+ assert(tmp);
+ _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, Audio::makeFlacStream(tmp, true), SOUND_SPEECH_ID, speechVol, speechPan);
// with compressed audio, we can't calculate the wave volume.
// so default to talking.
for (int cnt = 0; cnt < 480; cnt++)
@@ -212,7 +214,9 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
#ifdef USE_VORBIS
else if (_cowMode == CowVorbis) {
_cowFile.seek(index);
- _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, Audio::makeVorbisStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
+ Common::MemoryReadStream *tmp = _cowFile.readStream(sampleSize);
+ assert(tmp);
+ _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, Audio::makeVorbisStream(tmp, true), SOUND_SPEECH_ID, speechVol, speechPan);
// with compressed audio, we can't calculate the wave volume.
// so default to talking.
for (int cnt = 0; cnt < 480; cnt++)
@@ -223,7 +227,9 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
#ifdef USE_MAD
else if (_cowMode == CowMp3) {
_cowFile.seek(index);
- _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, Audio::makeMP3Stream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
+ Common::MemoryReadStream *tmp = _cowFile.readStream(sampleSize);
+ assert(tmp);
+ _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, Audio::makeMP3Stream(tmp, true), SOUND_SPEECH_ID, speechVol, speechPan);
// with compressed audio, we can't calculate the wave volume.
// so default to talking.
for (int cnt = 0; cnt < 480; cnt++)