From a61e62db95d30c9886cf2e66e84f9e753c04f2d5 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sat, 14 Jan 2006 20:05:56 +0000 Subject: 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 --- sound/softsynth/fluidsynth.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sound/softsynth') 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); -- cgit v1.2.3