diff --git a/engines/grim/emi/sound/emisound.h b/engines/grim/emi/sound/emisound.h index 8ca136b95f2..67455dbd7d5 100644 --- a/engines/grim/emi/sound/emisound.h +++ b/engines/grim/emi/sound/emisound.h @@ -53,9 +53,9 @@ class EMISound { public: EMISound(int fps); ~EMISound(); - bool startVoice(const Common::String &soundName, int volume = 127, int pan = 64); - bool startSfx(const Common::String &soundName, int volume = 127, int pan = 64); - bool startSfxFrom(const Common::String &soundName, const Math::Vector3d &pos, int volume = 127); + bool startVoice(const Common::String &soundName, int volume = 100, int pan = 64); + bool startSfx(const Common::String &soundName, int volume = 100, int pan = 64); + bool startSfxFrom(const Common::String &soundName, const Math::Vector3d &pos, int volume = 100); bool getSoundStatus(const Common::String &soundName); void stopSound(const Common::String &soundName); int32 getPosIn16msTicks(const Common::String &soundName); diff --git a/engines/grim/emi/sound/track.cpp b/engines/grim/emi/sound/track.cpp index 11d75a3b892..ee8a917203f 100644 --- a/engines/grim/emi/sound/track.cpp +++ b/engines/grim/emi/sound/track.cpp @@ -39,7 +39,7 @@ SoundTrack::SoundTrack() { _paused = false; _positioned = false; _balance = 0; - _volume = Audio::Mixer::kMaxChannelVolume; + _volume = 100; _disposeAfterPlaying = DisposeAfterUse::YES; _sync = 0; _fadeMode = FadeNone; @@ -64,6 +64,9 @@ void SoundTrack::setSoundName(const Common::String &name) { } void SoundTrack::setVolume(int volume) { + if (volume > 100) { + volume = 100; + } _volume = volume; if (_handle) { g_system->getMixer()->setChannelVolume(*_handle, (byte)getEffectiveVolume()); @@ -146,7 +149,8 @@ void SoundTrack::setFade(float fade) { } int SoundTrack::getEffectiveVolume() { - return _volume * _attenuation * _fade; + int mixerVolume = _volume * Audio::Mixer::kMaxChannelVolume / 100; + return mixerVolume * _attenuation * _fade; } } // end of namespace Grim