'FluidSynth() output volume is too low
in my python script i am using fluidSynth to convert .mid files to .wav files
fs = FluidSynth()
fs.midi_to_audio('myfile.mid', 'myfile.wav')
fluidSynth successfully converts myfile.mid to myfile.wav and saves the output, everything goes well.
the problem is the output volume is too low
i saw in fluidSynth documentation is that i can insert option -g
or --gain
to fluildSynth to increase the default volume of 0.2
so in the FluidSynth()
instance, in the python script, how can i pass the -g option to increace output volume?!
any help would be much appreciated.
Solution 1:[1]
It looks like you're using midi2audio, I'm not sure you're able to pass fluidsynth options in that. Since you have fluidsynth installed you could call it directly using the subprocess module and then you have access to all the options including gain.
Example setting the gain to 5:
subprocess.run(['fluidsynth', '-ni', '-g', '5', 'path to soundfont', 'myfile.mid', '-F', 'myfile.wav'])
This will make it louder. Gain isn't necessarily the same as volume but I don't understand enough about sound engineering to tell the difference.
Solution 2:[2]
This solution works very well. In your python code you also need to
import subprocess
subprocess is not built into python and needs an import to work successfull.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | CameronD |
Solution 2 |