How do you use midi2audio in Python with Windows?

1.1k views Asked by At

I need to convert a midi file into .wav or .mp3 in Python to be able to play it in a Django web app. I came across midi2audio which seemed to solve just that, but it seems like it was made for Linux and MacOS, so it's a bit of a pain with Windows (which I am using).

I have installed midi2audio and fluidsynth and added it to path, but when I write

from midi2audio import FluidSynth
FluidSynth().midi_to_audio('temp.mid', 'output.wav')

and run it there is an error that pops up, not a python error but a windows error saying "Command line syntax error. Type Command /? for Help.". I'm guessing I have to configure something in fluidsynth, but I have no idea how and I didn't really find anything useful online.

How can I get fluidsynth to work, or what is a better way to convert midi to mp3/wav?

0

There are 0 answers