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

FluidSynth: support for custom sample rate

parent 3ead74ab
...@@ -2882,7 +2882,7 @@ fi ...@@ -2882,7 +2882,7 @@ fi
dnl dnl
dnl libfluidsynth (MIDI synthetizer) plugin dnl libfluidsynth (MIDI synthetizer) plugin
dnl dnl
PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.0], [MIDI synthetiser with libfluidsynth], [auto]) PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
dnl dnl
dnl Teletext Modules dnl Teletext Modules
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#define GAIN_LONGTEXT N_("This gain is applied to synthesis output. " \ #define GAIN_LONGTEXT N_("This gain is applied to synthesis output. " \
"High values may cause saturation when many notes are played at a time." ) "High values may cause saturation when many notes are played at a time." )
#define SAMPLE_RATE_TEXT N_("Sample rate")
static int Open (vlc_object_t *); static int Open (vlc_object_t *);
static void Close (vlc_object_t *); static void Close (vlc_object_t *);
...@@ -66,6 +67,9 @@ vlc_module_begin () ...@@ -66,6 +67,9 @@ vlc_module_begin ()
SOUNDFONT_TEXT, SOUNDFONT_LONGTEXT, false) SOUNDFONT_TEXT, SOUNDFONT_LONGTEXT, false)
add_float ("synth-gain", 0.8, GAIN_TEXT, GAIN_LONGTEXT, false) add_float ("synth-gain", 0.8, GAIN_TEXT, GAIN_LONGTEXT, false)
change_float_range (0., 10.) change_float_range (0., 10.)
add_integer ("synth-sample-rate", 44100,
SAMPLE_RATE_TEXT, SAMPLE_RATE_TEXT, true)
change_integer_range (22050, 96000)
vlc_module_end () vlc_module_end ()
...@@ -146,7 +150,9 @@ static int Open (vlc_object_t *p_this) ...@@ -146,7 +150,9 @@ static int Open (vlc_object_t *p_this)
var_InheritFloat (p_this, "synth-gain")); var_InheritFloat (p_this, "synth-gain"));
p_dec->fmt_out.i_cat = AUDIO_ES; p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.audio.i_rate = 44100; p_dec->fmt_out.audio.i_rate =
var_InheritInteger (p_this, "synth-sample-rate");;
fluid_synth_set_sample_rate (p_sys->synth, p_dec->fmt_out.audio.i_rate);
p_dec->fmt_out.audio.i_channels = 2; p_dec->fmt_out.audio.i_channels = 2;
p_dec->fmt_out.audio.i_original_channels = p_dec->fmt_out.audio.i_original_channels =
p_dec->fmt_out.audio.i_physical_channels = p_dec->fmt_out.audio.i_physical_channels =
......
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