aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-01-14 20:05:56 +0000
committerTorbjörn Andersson2006-01-14 20:05:56 +0000
commita61e62db95d30c9886cf2e66e84f9e753c04f2d5 (patch)
tree8b3f192d2c74ef1c40187d3f106c3ffe56b21bd5 /sound/softsynth
parentd8d6da1ff0defa13d4f458e1a6340c5254c76a2d (diff)
downloadscummvm-rg350-a61e62db95d30c9886cf2e66e84f9e753c04f2d5.tar.gz
scummvm-rg350-a61e62db95d30c9886cf2e66e84f9e753c04f2d5.tar.bz2
scummvm-rg350-a61e62db95d30c9886cf2e66e84f9e753c04f2d5.zip
Lowered FluidSynth's default gain, and added config file and command-line
options to specify it. FluidSynth's gain ranges from 0.0 through 10.0 and is probably measured in decibel, but to keep things simple, ScummVM uses settings from 0 through 1000 instead. (Though currently there's no guard against invalid settings.) This is a slightly revised version of the non-GUI part of patch #1336171. svn-id: r20030
Diffstat (limited to 'sound/softsynth')
-rw-r--r--sound/softsynth/fluidsynth.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/softsynth/fluidsynth.cpp b/sound/softsynth/fluidsynth.cpp
index a3aaab3bcb..e0ded4596f 100644
--- a/sound/softsynth/fluidsynth.cpp
+++ b/sound/softsynth/fluidsynth.cpp
@@ -114,10 +114,14 @@ int MidiDriver_FluidSynth::open() {
_settings = new_fluid_settings();
- // The default gain setting is ridiculously low, but we can't set it
- // too high either or sound will be clipped. This may need tuning...
+ // The default gain setting is ridiculously low - at least for me. This
+ // cannot be fixed by ScummVM's volume settings because they can only
+ // soften the sound, not amplify it, so instead we add an option to
+ // adjust the gain of FluidSynth itself.
- setNum("synth.gain", 2.1);
+ double gain = (double)ConfMan.getInt("midi_gain") / 100.0;
+
+ setNum("synth.gain", gain);
setNum("synth.sample-rate", _outputRate);
_synth = new_fluid_synth(_settings);