python-3.x 使用scamp时FluidSynth不可用

dwbf0jvd  于 2022-12-20  发布在  Python
关注(0)|答案(1)|浏览(122)

我有以下样板代码

from scamp import *

s = Session()
s.tempo = 120

clarinet = s.new_part("clarinet")

当我运行它的时候,我得到了错误

Traceback (most recent call last):
  File "/home/norhther/Descargas/music.py", line 6, in <module>
    clarinet = s.new_part("clarinet")
  File "/home/norhther/.local/lib/python3.9/site-packages/scamp/instruments.py", line 184, in new_part
    instrument.add_soundfont_playback(preset=preset, soundfont=soundfont, num_channels=num_channels,
  File "/home/norhther/.local/lib/python3.9/site-packages/scamp/instruments.py", line 984, in add_soundfont_playback
    SoundfontPlaybackImplementation(bank_and_preset=preset, soundfont=soundfont, num_channels=num_channels,
  File "/home/norhther/.local/lib/python3.9/site-packages/scamp/playback_implementations.py", line 327, in __init__
    SoundfontHost(
  File "/home/norhther/.local/lib/python3.9/site-packages/scamp/_soundfont_host.py", line 176, in __init__
    raise ModuleNotFoundError("FluidSynth not available.")
ModuleNotFoundError: FluidSynth not available.

我在我的系统(Ubuntu)中安装了FluidSynth,我可以毫无问题地执行它。我还使用了pip安装pyFluidSynthpip

wribegjk

wribegjk1#

注:此答案早于OP编辑问题;这个问题确实包含了所引用的短语。
我还将pip install fluidsynthpip一起使用
PyPI上的fluidsynth软件包最后一次更新是在2012年,SCAMP与FluidSynth连接时并不依赖该软件包。要安装的正确软件包名为pyFluidSynth。要安装该软件包,请运行以下命令。

pip install pyFluidSynth

您还必须卸载错误的fluidsynth包。

pip uninstall fluidsynth

相关问题