SCI: kDoAudio now also clips volume and adjusts to mixer volume

svn-id: r46852
This commit is contained in:
Martin Kiewitz 2010-01-01 21:26:46 +00:00
parent f3ca535038
commit 44dc3f9bfb
2 changed files with 7 additions and 2 deletions

View File

@ -131,9 +131,12 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) {
case kSciAudioRate:
s->_audio->setAudioRate(argv[1].toUint16());
break;
case kSciAudioVolume:
mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, argv[1].toUint16());
case kSciAudioVolume: {
int16 volume = argv[1].toUint16();
volume = CLIP<int16>(volume, 0, AUDIO_VOLUME_MAX);
mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, volume * 2);
break;
}
case kSciAudioLanguage:
// In SCI1.1: tests for digital audio support
if (getSciVersion() == SCI_VERSION_1_1)

View File

@ -51,6 +51,8 @@ enum AudioSyncCommands {
kSciAudioSyncStop = 2
};
#define AUDIO_VOLUME_MAX 127
class Resource;
class ResourceId;
class ResourceManager;