我在没有 jack 并运行 Python 2.7 的 Ubuntu 14.04 上安装了 pyo。我遵循了pyo wiki 中编写的基于 Debian 的安装说明。这是我使用的代码(它在pyo 介绍页面中):
from pyo import *
s = Server().boot()
s.start()
a = Sine(mul=0.01).out()
结果得到:
pyo version 0.6.8 (uses single precision)
ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514
Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2818
portaudio error in Pa_OpenStream: Invalid number of channels
Portaudio error: Invalid number of channels
Server not booted.
The Server must be booted!
Traceback (most recent call last):
File "/host/Python/Synth/synther.py", line 4, in <module>
a = Sine(mul=0.01).out()
File "/usr/lib/python2.7/dist-packages/pyolib/generators.py", line 58, in __init__
PyoObject.__init__(self, mul, add)
File "/usr/lib/python2.7/dist-packages/pyolib/_core.py", line 376, in __init__
PyoObjectBase.__init__(self)
File "/usr/lib/python2.7/dist-packages/pyolib/_core.py", line 262, in __init__
raise PyoServerStateException("The Server must be booted before creating any audio object.")
pyolib._core.PyoServerStateException: The Server must be booted before creating any audio object.
PS:对使用jack不感兴趣,已经遇到问题了。