简体   繁体   English

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

[英]Error reading audio with python on Ubuntu 14.04

When running the following code using python 2.7 (in Ubuntu 14.04)使用 python 2.7 运行以下代码时(在 Ubuntu 14.04 中)

import pyaudio
p = pyaudio.PyAudio()

I get the following exception:我收到以下异常:

ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) 无法打开从站

ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) 无法打开从站

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

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

bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open:connect() 失败:连接被拒绝 (111)

bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open:connect() 失败:连接被拒绝 (111)

bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open:connect() 失败:连接被拒绝 (111)

bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open:connect() 失败:连接被拒绝 (111)

ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) 无法打开从站

Cannot connect to server socket err = No such file or directory无法连接到服务器套接字 err = 没有这样的文件或目录

Cannot connect to server request channel jack server is not running or cannot be started无法连接到服务器请求通道插孔服务器未运行或无法启动

Your help would be highly appreciated您的帮助将不胜感激

Do you have bluez-alsa package installed?您是否安装了bluez-alsa软件包? If so remove it, and re-test.如果是这样,请将其删除,然后重新测试。 Should get rid of the errors.应该摆脱错误。

If not there is also some discussion here ( https://github.com/Katee/quietnet/issues/18 ) that might be helpful.如果没有,这里也有一些讨论( https://github.com/Katee/quietnet/issues/18 )可能会有所帮助。

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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM