1

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?

  • According to the [requirements](https://github.com/bzamecnik/midi2audio#requirements), you'll need FluidSynth and some sound fonts on your system already. It explains how to put in the soundfonts but there's probably documentation elsewhere on putting soundfonts in FluidSynth on Windows specifically. Does your system meet those requirements? The Windows release of FluidSynth is here: https://github.com/urtnl/fluidsynth/releases/tag/v2.2.3 – Random Davis Nov 26 '21 at 21:43
  • I have fluidsinth installed, but I don't think I have sound fonts. Even if I get one, how do I tell fluidsynth 'hey here is a font you can use'? – Daniel Barac Nov 26 '21 at 21:46
  • That's what I'm not sure of, hence why I suggested that there's probably documentation somewhere on where to put sondfonts on windows. – Random Davis Nov 26 '21 at 21:47
  • Ok, I'll look into that – Daniel Barac Nov 26 '21 at 21:48

0 Answers0