赞
踩
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
情况和这个相同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+)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。