列出与Python的pyaudio所有的音频设备(portaudio绑定) [英] List all audio devices with Python's pyaudio (portaudio binding)

查看:3753
本文介绍了列出与Python的pyaudio所有的音频设备(portaudio绑定)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过

import pyaudio
p = pyaudio.PyAudio()
for i in range(p.get_device_count()):
    print p.get_device_info_by_index(i)

但我没有得到所有设备的完整列表:比如我并不在此列表中获得ASIO设备。这就奇怪了,因为 portaudio 应该给ASIO设备,以及,对吧?

but I don't get the full list of all devices : for example I don't get ASIO devices in this list. This is strange, because portaudio should give ASIO devices as well, right ?

如何列出所有的音频设备 pyaudio

How can I list all audio devices with pyaudio ?

推荐答案

我觉得你的期望是合理的。等效C code到枚举PortAudio设备会给你所有可用设备。有一对夫妇的事情是错的:

I think your expectations are reasonable. The equivalent C code to enumerate PortAudio devices would give you all available devices. There are a couple of things that could be wrong:


  • 您PyAudio的构建尚未编译ASIO支持。 PortAudio只列举设备编译时编译已配置本地主机的API /。

  • Your build of PyAudio has not been compiled with ASIO support. PortAudio will only enumerate devices for the native host APIs that have been configured/compiled in at compile time.

您的Python / PyAudio和你ASIO的64位版本的设备驱动程序是32位或VIS-反之亦然(64位ASIO驱动程序和32位的Python)。

You have a 64-bit build of Python/PyAudio and your ASIO device drivers are 32-bit, or vis-versa (64-bit ASIO drivers and 32-bit Python).

多媒体麦克建议,可以从公式由PortAudio分布从C枚举PA设备的pa_devs.c程序消除PyAudio做到这一点。

As Multimedia Mike suggests, you can eliminate PyAudio from the equation by enumerating PA devices from C. The pa_devs.c program in the PortAudio distribution does this.

这篇关于列出与Python的pyaudio所有的音频设备(portaudio绑定)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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