Commit 3ead74ab authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

FluidSynth: add gain setting and better default value

The default gain of 0.2 was way too low compared to other audio codecs.
parent 6bd01d08
......@@ -47,6 +47,11 @@
#define SOUNDFONT_LONGTEXT N_( \
"A sound fonts file is required for software synthesis." )
#define GAIN_TEXT N_("Synthesis gain")
#define GAIN_LONGTEXT N_("This gain is applied to synthesis output. " \
"High values may cause saturation when many notes are played at a time." )
static int Open (vlc_object_t *);
static void Close (vlc_object_t *);
......@@ -58,7 +63,9 @@ vlc_module_begin ()
set_subcategory (SUBCAT_INPUT_ACODEC)
set_callbacks (Open, Close)
add_loadfile ("soundfont", "",
SOUNDFONT_TEXT, SOUNDFONT_LONGTEXT, false);
SOUNDFONT_TEXT, SOUNDFONT_LONGTEXT, false)
add_float ("synth-gain", 0.8, GAIN_TEXT, GAIN_LONGTEXT, false)
change_float_range (0., 10.)
vlc_module_end ()
......@@ -135,6 +142,9 @@ static int Open (vlc_object_t *p_this)
return VLC_EGENERIC;
}
fluid_synth_set_gain (p_sys->synth,
var_InheritFloat (p_this, "synth-gain"));
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.audio.i_rate = 44100;
p_dec->fmt_out.audio.i_channels = 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment