在Ubuntu 14.04上使用python读取音频时出错

在Ubuntu 14.04上使用python读取音频时出错,python,python-2.7,pyaudio,Python,Python 2.7,Pyaudio,使用Python2.7(在Ubuntu 14.04中)运行以下代码时 我得到以下例外情况: ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_打开)无法打开从机 ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_打开)无法打开从机 ALSA lib pcm.c:2239:(snd_pcm_open_noupdate)未知pcm卡.pcm.center_lfe ALSA lib pcm.c:2239:(snd_pcm_open_noup

使用Python2.7(在Ubuntu 14.04中)运行以下代码时

我得到以下例外情况:

ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_打开)无法打开从机

ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_打开)无法打开从机

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate)未知pcm卡.pcm.center_lfe

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate)未知pcm卡.pcm.side

bt_音频_服务_打开:连接()失败:连接被拒绝(111)

bt_音频_服务_打开:连接()失败:连接被拒绝(111)

bt_音频_服务_打开:连接()失败:连接被拒绝(111)

bt_音频_服务_打开:连接()失败:连接被拒绝(111)

ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_打开)无法打开从机

无法连接到服务器套接字err=没有此类文件或目录

无法连接到服务器请求通道jack服务器未运行或无法启动


非常感谢您的帮助

您是否安装了
bluez alsa
软件包?如果是这样,请将其拆下,然后重新测试。应该消除错误

如果没有,这里还有一些讨论()可能会有所帮助

ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred

The underun is likely caused because pulseaudio is already accessing 
the card - you can pause it using http://linux.die.net/man/1
/pasuspender. In general to avoid such deadlock, you need a 
soundserver like jackd https://help.ubuntu.com/community/What%20is%20JACK, but you already figured this out from the following log
entries in your trace ;-) (apt-get install jackd)

我删除了bluez alsa,删除了“bt_audio_service_open”错误,但录制的内容仍然无法与Ubuntu20.04 python3.6中的错误相同
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred

The underun is likely caused because pulseaudio is already accessing 
the card - you can pause it using http://linux.die.net/man/1
/pasuspender. In general to avoid such deadlock, you need a 
soundserver like jackd https://help.ubuntu.com/community/What%20is%20JACK, but you already figured this out from the following log
entries in your trace ;-) (apt-get install jackd)