当前位置:   article > 正文

linux usb免驱麦克风,pyaudio检测不到USB 麦克风

pyaudio无法获取录音设备

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

情况和这个相同https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=261579

lsusb和arecord -l 都可以查到usb麦克,但是使用pyaudio无法使用usb麦克录音。

~$ lsusb

Bus 001 Device 007: ID 8086:0808 Intel Corp.

Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp.

Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub

Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

~$ arecord -l

**** List of CAPTURE Hardware Devices ****

card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]

Subdevices: 1/1

Subdevice #0: subdevice #0

puaudio测试,只有1个默认设备,USB设备信息检测不到

>>> import pyaudio

>>> pa = pyaudio.PyAudio()

>>> pa.get_default_input_device_info()

{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultLowInputLatency': 0.008707482993197279, 'maxInputChannels': 16L, 'structVersion': 2L, 'hostApi': 0L, 'index': 0L, 'defaultHighOutputLatency': 0.034829931972789115, 'maxOutputChannels': 16L, 'name': u'/dev/dsp', 'defaultHighInputLatency': 0.034829931972789115}

>>> pa.get_device_count()

1L

>>> pa.get_device_info_by_index(0)

{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultLowInputLatency': 0.008707482993197279, 'maxInputChannels': 16L, 'structVersion': 2L, 'hostApi': 0L, 'index': 0, 'defaultHighOutputLatency': 0.034829931972789115, 'maxOutputChannels': 16L, 'name': u'/dev/dsp', 'defaultHighInputLatency': 0.034829931972789115}

>>> pa.get_device_info_by_index(1)

Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 977, in get_device_info_by_index pa.get_device_info(device_index)IOError: [Errno Invalid device info] -9996

有大佬知道该怎么解决吗?(python2.7 树莓派3B+)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/326010
推荐阅读
相关标签
  

闽ICP备14008679号