diff options
Diffstat (limited to 'scumm/sound.cpp')
-rw-r--r-- | scumm/sound.cpp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 42e7280329..13217e710c 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -34,7 +34,9 @@ #include "sound/audiocd.h" #include "sound/mididrv.h" #include "sound/mixer.h" +#include "sound/mp3.h" #include "sound/voc.h" +#include "sound/vorbis.h" namespace Scumm { @@ -811,27 +813,27 @@ void Sound::pauseSounds(bool pause) { void Sound::startSfxSound(File *file, int file_size, PlayingSoundHandle *handle, int id) { + AudioInputStream *input; + + if (file_size > 0) { if (_vorbis_mode) { #ifdef USE_VORBIS - _scumm->_mixer->playVorbis(handle, file, file_size, 255, 0, id); + input = makeVorbisStream(file, file_size); #endif } else { #ifdef USE_MAD - _scumm->_mixer->playMP3(handle, file, file_size, 255, 0, id); + input = makeMP3Stream(file, file_size); #endif } - return; + } else { + input = makeVOCStream(_sfxFile); } - int size; - int rate; - byte *data = loadVOCFile(_sfxFile, size, rate); - if (_scumm->_imuseDigital) { - _scumm->_imuseDigital->startSound(kTalkSoundID, data, size, rate); + _scumm->_imuseDigital->startSound(kTalkSoundID, 0, input); } else { - _scumm->_mixer->playRaw(handle, data, size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED, id); + _scumm->_mixer->playInputStream(handle, input, false, 255, 0, id); } } @@ -844,16 +846,6 @@ File *Sound::openSfxFile() { * same directory */ offset_table = NULL; - // FIXME / TODO / HACK: for FT voice can only be loaded from original .sou - // files, not .so3 or .sog. This will be so until IMuseDigital gets fixed. - if (_scumm->_imuseDigital) { - sprintf(buf, "%s.sou", _scumm->getGameName()); - if (!file->open(buf, _scumm->getGameDataPath())) { - file->open("monster.sou", _scumm->getGameDataPath()); - } - return file; - } - #ifdef USE_MAD sprintf(buf, "%s.so3", _scumm->getGameName()); if (!file->open(buf, _scumm->getGameDataPath())) { |