diff options
author | Max Horn | 2004-12-27 16:24:49 +0000 |
---|---|---|
committer | Max Horn | 2004-12-27 16:24:49 +0000 |
commit | bc3b3517b286894cfe2055bdefa7ceaadc49cdac (patch) | |
tree | ebaefca2b692e474cbef0394b4b479c0da17cd50 /scumm | |
parent | 1d44b0873fd124ddc394ec992c469cb079352e8b (diff) | |
download | scummvm-rg350-bc3b3517b286894cfe2055bdefa7ceaadc49cdac.tar.gz scummvm-rg350-bc3b3517b286894cfe2055bdefa7ceaadc49cdac.tar.bz2 scummvm-rg350-bc3b3517b286894cfe2055bdefa7ceaadc49cdac.zip |
Merge startSfxSound into startTalkSound
svn-id: r16338
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/sound.cpp | 80 | ||||
-rw-r--r-- | scumm/sound.h | 1 |
2 files changed, 38 insertions, 43 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp index e6f1e9e2c2..b5da30bd77 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -732,8 +732,44 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, PlayingSoundHandle _mouthSyncMode = true; } - if (!_soundsPaused && _vm->_mixer->isReady()) - startSfxSound(_sfxFile, size, handle, id); + if (!_soundsPaused && _vm->_mixer->isReady()) { + AudioStream *input = NULL; + + switch (_soundMode) { + case kMP3Mode: + #ifdef USE_MAD + assert(size > 0); + input = makeMP3Stream(_sfxFile, size); + #endif + break; + case kVorbisMode: + #ifdef USE_VORBIS + assert(size > 0); + input = makeVorbisStream(_sfxFile, size); + #endif + break; + case kFlacMode: + #ifdef USE_FLAC + assert(size > 0); + input = makeFlacStream(_sfxFile, size); + #endif + break; + default: + input = makeVOCStream(*_sfxFile); + } + + if (!input) { + warning("startSfxSound failed to load sound"); + return; + } + + if (_vm->_imuseDigital) { + //_vm->_imuseDigital->stopSound(kTalkSoundID); + _vm->_imuseDigital->startVoice(kTalkSoundID, input); + } else { + _vm->_mixer->playInputStream(SoundMixer::kSFXAudioDataType, handle, input, id); + } + } } void Sound::stopTalkSound() { @@ -993,46 +1029,6 @@ void Sound::pauseSounds(bool pause) { } } -void Sound::startSfxSound(File *file, int file_size, PlayingSoundHandle *handle, int id) { - - AudioStream *input = NULL; - - switch (_soundMode) { - case kMP3Mode: -#ifdef USE_MAD - assert(file_size > 0); - input = makeMP3Stream(file, file_size); -#endif - break; - case kVorbisMode: -#ifdef USE_VORBIS - assert(file_size > 0); - input = makeVorbisStream(file, file_size); -#endif - break; - case kFlacMode: -#ifdef USE_FLAC - assert(file_size > 0); - input = makeFlacStream(file, file_size); -#endif - break; - default: - input = makeVOCStream(*_sfxFile); - } - - if (!input) { - warning("startSfxSound failed to load sound"); - return; - } - - if (_vm->_imuseDigital) { - //_vm->_imuseDigital->stopSound(kTalkSoundID); - _vm->_imuseDigital->startVoice(kTalkSoundID, input); - } else { - _vm->_mixer->playInputStream(SoundMixer::kSFXAudioDataType, handle, input, id); - } -} - ScummFile *Sound::openSfxFile() { struct SoundFileExtensions { const char *ext; diff --git a/scumm/sound.h b/scumm/sound.h index 6ef8989783..a374eced17 100644 --- a/scumm/sound.h +++ b/scumm/sound.h @@ -123,7 +123,6 @@ public: protected: ScummFile *openSfxFile(); - void startSfxSound(File *file, int file_size, PlayingSoundHandle *handle, int id = -1); bool isSfxFinished() const; void processSfxQueues(); |