PyAudio 找不到任何输出设备 [英] PyAudio cannot find any output devices

查看:109
本文介绍了PyAudio 找不到任何输出设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我跑步时:

import pyaudio
pa = pyaudio.PyAudio()
pa.get_default_output_device_info()

我明白了:

IOError: No Default Output Device Available

当我说:

pa.get_device_count()

返回0L.

当然如果我列出设备

for i in range(0, device_count):
        print("Name: " + pa.get_device_info_by_index(i)["name"])
        print("Index: " + pa.get_device_info_by_index(i)["index"])
        print("\n")

它不会打印任何东西.

我正在运行 Ubuntu 16.04 并通过以下方式设置了我的默认接收器:

I'm running Ubuntu 16.04 and have set my default sink by going:

pacmd list-sinks
pacmd set-default-sink 0

我有最新版本的 PulseAudio、ALSA 和 PortAudio.有什么建议吗?

I have the latest versions of PulseAudio, ALSA, and PortAudio. Any suggestions?

更新:我也无法在 Audacity 上查看任何声音设备,尽管它们出现在系统设置">声音"下.在 Audacity 中,我收到错误:

Update: I also can't view any sound devices on Audacity, despite the fact that they appear under System Settings>Sound. In Audacity I get the error:

打开声音设备时出错.请检查录音设备设置和项目采样率.

Error while opening sound device. Please check the recording device settings and the project sample rate.

我认为这几乎肯定是 PortAudio 问题,因为设置页面如下所示:

I think that this is almost certainly a PortAudio issue since the settings page looks like:

推荐答案

可能是损坏的文件需要更换.

Its likely a broken file that needs replacement.

  1. 在pip安装的地方搜索/usr/./libstdc++.so.6".

  1. Search for "/usr/./libstdc++.so.6" where pip installed it.

搜索/usr/lib/x86_64-linux-gnu/libstdc++.so.6"并复制到 (1) 处的位置.这应该可以解决它.

Search for "/usr/lib/x86_64-linux-gnu/libstdc++.so.6" and copy to location at (1). This should fix it.

如果您安装了 Anaconda 版本 3 - 4.3.0 或 4.4.0 或更早版本,请检查anaconda3/lib/libstdc++.so.6"并重新使用 (2).

If you have Anaconda version 3 - 4.3.0 or 4.4.0 or earlier installed then check at "anaconda3/lib/libstdc++.so.6" and replance with (2).

或者 A) 重命名文件并将文件从 (2) 重命名旧的 libstdc++.so.6 文件或 B) 升级到 Anaconda 到 5.0.1 版本并运行 conda update --all.如果您执行B",请不要忘记先手动删除鸡蛋或 whl,以确保没有机会再次从那里安装旧软件.

Alternatively A) rename the file and place the file from (2) where you renamed the old libstdc++.so.6 file or B) upgrade to Anaconda to 5.0.1 version and run conda update --all. And if you do "B" don't forget to remove the eggs or whls manually first to be sure there is no chance installing old software from there again.

这应该会为您解决问题.

This should fix it for you.

享受;-)

这篇关于PyAudio 找不到任何输出设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆