TWINE: use voice volume for speech

This commit is contained in:
Martin Gerhardy 2020-10-31 13:01:46 +01:00
parent cc4e3a30d8
commit a286db2d3c
2 changed files with 5 additions and 5 deletions

View File

@ -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;
}

View File

@ -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);