Python 运行PyFluidSync+;pyaudio演示,alsa和jack存在许多问题

Python 运行PyFluidSync+;pyaudio演示,alsa和jack存在许多问题,python,alsa,pyaudio,fluidsynth,Python,Alsa,Pyaudio,Fluidsynth,我正在看演示。我对通过Python创建音频非常陌生,所以我不知道如何调试我应该考虑哪些错误,我可能犯了什么错误。< /P> 以下是我的python错误: >>> import time >>> import numpy >>> import pyaudio >>> import fluidsynth >>> >>> pa = pyaudio.PyAudio() ALSA lib pcm_

我正在看演示。我对通过Python创建音频非常陌生,所以我不知道如何调试我应该考虑哪些错误,我可能犯了什么错误。< /P> 以下是我的python错误:

>>> import time
>>> import numpy
>>> import pyaudio
>>> import fluidsynth
>>> 
>>> pa = pyaudio.PyAudio()
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
>>> strm = pa.open(
...     format = pyaudio.paInt16,
...     channels = 2, 
...     rate = 44100, 
...     output = True)
>>> 
>>> s = []
>>> 
>>> fl = fluidsynth.Synth()
>>> 
>>> # Initial silence is 1 second
... s = numpy.append(s, fl.get_samples(44100 * 1))
>>> 
>>> sfid = fl.sfload("example.sf2")
fluidsynth: error: Unable to open file "example.sf2"
fluidsynth: error: Couldn't load soundfont file
fluidsynth: error: Failed to load SoundFont "example.sf2"
>>> fl.program_select(0, sfid, 0, 0)
fluidsynth: error: There is no preset with bank number 0 and preset number 0 in SoundFont -1
-1
>>> 
>>> fl.noteon(0, 60, 30)
-1
>>> fl.noteon(0, 67, 30)
-1
>>> fl.noteon(0, 76, 30)
-1
>>> 
>>> # Chord is held for 2 seconds
... s = numpy.append(s, fl.get_samples(44100 * 2))

我已经成功安装了pyaudio、FluidSync、PyFluidSync,如果这有什么不同的话,我正在运行ubuntu 12.10。

您的音频输出没有配置,您需要一个声音字体文件。自述文件没有这两个方面的说明。您有任何链接、教程或起点吗?相关