我不能导入fluidsynth。也许有更好的模块?
我正在尝试从python或pygame合成midi。我可以从pygame发送midi事件。我使用的是mingus,而pyfluidsynth似乎是最好的/最简单的。
我认为这意味着已经安装了pyfluidsynth,但是没有安装单独的fluidsynth。我不知道它是否需要一个'fluidsynth‘安装程序才能工作?
test.py:
import fluidsynth
print ":("错误:
Traceback (most recent call last):
File "test.py", line 1, in <module>
import fluidsynth
File "C:\Users\jake\AppData\Roaming\Python\Python27\site-packages\fluidsynth.py", line 34, in <module>
raise ImportError, "Couldn't find the FluidSynth library."
ImportError: Couldn't find the FluidSynth library.使用: python 2.7-win32
发布于 2011-04-26 06:48:47
python fluidsynth模块正在寻找FluidSynth二进制库文件(即fluidsynth.dll)。
要得到这个,你可以下载、编译和安装http://sourceforge.net/projects/fluidsynth/files/fluidsynth-1.1.3/
或
您可以使用fluidsynth (即QSynth)找到包含.dll文件的预编译副本的项目。
发布于 2013-05-22 20:20:18
是的,您还需要FuildSynth库(windows的动态链接库)。
要使其与配合使用,请执行以下操作:
我把所有东西都放在同一个目录下(fluidsynth dll,PyFluidSynth模块,python script)。
并更改pyFluidSynth模块中的以下行(从第30行开始):
# A short circuited or expression to find the FluidSynth library
# (mostly needed for Windows distributions of libfluidsynth supplied with QSynth)
# and Dynamically link the FluidSynth library
lib = find_library('fluidsynth') or find_library('libfluidsynth') or find_library('libfluidsynth-1')
if lib is None:
_fl = ctypes.cdll.LoadLibrary("./libfluidsynth")
lib = "ok";
else:
_fl = CDLL(lib)
if lib is None:
raise ImportError, "Couldn't find the FluidSynth library."
# Helper function for declaring function prototypes它在这种设置下工作得很好。
发布于 2011-04-26 06:46:26
看看fluidsynth.py,你的猜测可能是对的。您应该尝试将fluidsynth.dll放在您系统的库搜索路径中的某个位置(最简单的可能是与您的脚本或fluidsynth.py相同的目录)。
我认为这个存档文件(通过谷歌找到)包含了必要的win32二进制文件:http://svn.drdteam.org/zdoom/fluidsynth.7z
https://stackoverflow.com/questions/5783913
复制相似问题