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

标签 python python-2.7 pyaudio

使用 python 2.7 运行以下代码时(在 Ubuntu 14.04 中)

import pyaudio
p = pyaudio.PyAudio()

我收到以下异常:

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.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

非常感谢您的帮助

最佳答案

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

如果没有,这里也有一些讨论(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)

关于python - 在 Ubuntu 14.04 上使用 python 读取音频时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33017555/

相关文章:

python - 使用 django-storages 和 s3 时出现 [Errno 32] Broken pipe

python - 将 UTF-16 转换为 UTF-8

multithreading - 用于多处理的 Python 信号

python - ImportError 没有名为 pyaudio 的模块

python - 在Python中不使用默认输出(播放)设备播放mp3文件

python - 如何从 Django 发送电子邮件

python - Sqlalchemy session ,删除似乎不起作用

python-2.7 - 统一码编码错误 : 'ascii' codec can't encode characters in position 62-11168: ordinal not in range(128)

python-2.7 - Flask-Sqlalchemy 3种多对多关系