【发布时间】:2018-06-03 04:56:58
【问题描述】:
我正在使用 python 包 midi2audio 将 midi 文件转换为 WAV。
跑步:
filepath = 'C:/Users/Jack/Documents/GaTech/Research/Code/Data/Midi/C4/test12.mid'
soundfont = 'C:/Users/Jack/Downloads/weedsgm3.sf2'
fs = FluidSynth(soundfont)
if os.path.isfile(filepath):
print('The File Exists')
else:
print('The File does not exist')
fs.midi_to_audio(filepath, 'output.wav')
输出:
The File Exists
FileNotFoundError: [WinError 2] The system cannot find the file specified
需要明确的是,错误是引用文件路径中指定的文件而不是 soundfont。包装上的文档很少,所以我不知道该怎么做。
有没有使用 midi2audio 经验的人遇到过同样的问题并知道问题的根源是什么?
【问题讨论】:
-
filepath的实际值是多少? -
我添加了包含文件路径的完整代码
标签: python-3.x midi audio-converter fluidsynth