[Scummvm-devel] Audio volume control (proposed mixer/imuse/... changes)

Max Horn max at quendi.de
Sun Nov 28 06:39:47 CET 2004

Yo folks,

currently, the volume settings in ScummVM are quite confusing, at least 
implementation wise, and at least when looking at the SCUMM code. Take 
a glimpse at ConfigDialog::close in scumm/dialogs.cpp to get an idea of 
what I mean :-)

To sum it up we currently have:
* the ability to set both a "global volume" and a "music volume" in the 
* the ability to tell the mixer whether a sound is "music" or "not 
* the mixer does volume processing based on this
* a premix hook which is treated as music, even though some engines may 
use it for other audio types, too
* before my recent changes, the premix data was not affected by the 
volume settings at all!
* settings in the config file for "master", "music", "sfx", "speech" 
* IMuseDigital does its own volume effects, based on these three types 
of audio data
* other backends probably add in their own complications :-)

My idea is to unify and simplify this. Here's what I suggest:

* we add a AudioDataType enum to the mixer; with audio types "none", 
"sfx", "speech", "music" (possibly more in the future)
* we add a method (or methods) to the mixer to set the volumes for each 
of the times
* when starting playback via the mixer, or when setting a premix hook, 
you can specify the audio type this is
* the data is then volume-scaled based on the volume set for that type
* type "none" is not volume scaled at all, which still allows engines 
to do their own volume effects if needed
* note: these are the "base" volumes; of course the ability to change 
the volume/balance of each sound directly will be retained!

* we need to discuss whether we want to / need to retain the global 
"master" volume. If we keep it, it should effect *everything*; setting 
it to 0 would effectively mute all sound.

As a consequence, we could simplify the audio options in SCUMM, get rid 
of the extra volume processing in IMuseDigitial, hopefully simplify the 
code in some of the other backends too, and overall end up with a more 
transparent yet more powerful SoundMixer.

What do you say, folks?



More information about the Scummvm-devel mailing list