From a286db2d3c32d3396a056a6e2f30078a9c9a4ab4 Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Sat, 31 Oct 2020 13:01:46 +0100 Subject: [PATCH] TWINE: use voice volume for speech --- engines/twine/sound.cpp | 8 ++++---- engines/twine/sound.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/engines/twine/sound.cpp b/engines/twine/sound.cpp index 7cc4123a094..9271c5f2737 100644 --- a/engines/twine/sound.cpp +++ b/engines/twine/sound.cpp @@ -94,7 +94,7 @@ void Sound::playSample(int32 index, int32 frequency, int32 repeat, int32 x, int3 uint8 *sampPtr = _engine->_resources->samplesTable[index]; int32 sampSize = _engine->_resources->samplesSizeTable[index]; - playSample(channelIdx, index, sampPtr, sampSize, repeat, Resources::HQR_SAMPLES_FILE, DisposeAfterUse::NO); + playSample(channelIdx, index, sampPtr, sampSize, repeat, Resources::HQR_SAMPLES_FILE, Audio::Mixer::kPlainSoundType, DisposeAfterUse::NO); } void Sound::playVoxSample(int32 index) { @@ -122,17 +122,17 @@ void Sound::playVoxSample(int32 index) { *sampPtr = 'C'; } - playSample(channelIdx, index, sampPtr, sampSize, 1, _engine->_text->currentVoxBankFile.c_str()); + playSample(channelIdx, index, sampPtr, sampSize, 1, _engine->_text->currentVoxBankFile.c_str(), Audio::Mixer::kSpeechSoundType); } -bool Sound::playSample(int channelIdx, int index, uint8 *sampPtr, int32 sampSize, int32 loop, const char *name, DisposeAfterUse::Flag disposeFlag) { +bool Sound::playSample(int channelIdx, int index, uint8 *sampPtr, int32 sampSize, int32 loop, const char *name, Audio::Mixer::SoundType soundType, DisposeAfterUse::Flag disposeFlag) { Common::MemoryReadStream *stream = new Common::MemoryReadStream(sampPtr, sampSize, disposeFlag); Audio::SeekableAudioStream *audioStream = Audio::makeVOCStream(stream, DisposeAfterUse::YES); if (audioStream == nullptr) { warning("Failed to create audio stream for %s", name); return false; } - _engine->_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &samplesPlaying[channelIdx], audioStream, index); + _engine->_system->getMixer()->playStream(soundType, &samplesPlaying[channelIdx], audioStream, index); return true; } diff --git a/engines/twine/sound.h b/engines/twine/sound.h index fddbf48d959..fc9d9c1bad7 100644 --- a/engines/twine/sound.h +++ b/engines/twine/sound.h @@ -59,7 +59,7 @@ private: /** Samples playing at a actors position */ int32 samplesPlayingActors[NUM_CHANNELS]{0}; - bool playSample(int channelIdx, int index, uint8 *sampPtr, int32 sampSize, int32 loop, const char *name, DisposeAfterUse::Flag disposeFlag = DisposeAfterUse::YES); + bool playSample(int channelIdx, int index, uint8 *sampPtr, int32 sampSize, int32 loop, const char *name, Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType, DisposeAfterUse::Flag disposeFlag = DisposeAfterUse::YES); bool isChannelPlaying(int32 channel);