2

我正在尝试让 pyfluidsynth 启动并运行。问题是我什至无法运行下载页面上提供的示例代码。以下是相关代码:

import time
import fluidsynth

fs = fluidsynth.Synth()
fs.start()

sfid = fs.sfload("example.sf2")
fs.program_select(0, sfid, 0, 0)

fs.noteon(0, 60, 30)
fs.noteon(0, 67, 30)
fs.noteon(0, 76, 30)

time.sleep(1.0)

fs.noteoff(0, 60)
fs.noteoff(0, 67)
fs.noteoff(0, 76)

time.sleep(1.0)

fs.delete()

不太确定问题出在哪里——据我所知,我已经安装了所有依赖项,还有什么没有。遵循错误消息:

Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jackdmp 1.9.7
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2010 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
JACK server starting in realtime mode with priority 10
Cannot lock down memory area (Cannot allocate memory)
control device hw:0
control device hw:0
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
control device hw:0
Using ALSA driver HDA-Intel running on card 0 - HDA Intel at 0xf4800000 irq 47
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback
Cannot use real-time scheduling (RR/10)(1: Operation not permitted)
AcquireSelfRealTime error
Cannot lock down memory area (Cannot allocate memory)
Cannot use real-time scheduling (RR/5)(1: Operation not permitted)
AcquireRealTime error
fluidsynth: Jack sample rate mismatch, adjusting. (synth.sample-rate=44100, jackd=48000)
fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
JackEngine::XRun: client = fluidsynth was not run: state = 2
JackAudioDriver::ProcessGraphAsync: Process error
JackActivationCount::Signal value = 0 ref = 2
JackTemporaryException : now quits...
jack main caught signal 2

有任何想法吗?

4

1 回答 1

0

Check the solution here: PyAudio working, but spits out error messages each time , especially the script provided by Nils Werner.

Its working for me, except that I continue to have following these 3 errors: "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"

于 2013-09-01T14:27:00.597 回答