Python/pyaudio running on wsl2 not detecting usb mic after it's been atached to the linux subsystem with usbipd

300 Views Asked by At

I'm trying to use pyaudio with vosk to write a speech to text program, which is running on a wsl. I've attached the usb port with the mic to the wsl using usbipd, which I can see has worked as the Q9-1 mic is listed when running lsusb:

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0d8c:0135 C-Media Electronics, Inc. Q9-1
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

However, pyaudio is unable to detect the mic. Running the following short script returns a mic count of 0:

import pyaudio
print(pyaudio.PyAudio().get_device_count())

Similarly, speech_recognition.Microphone.list_microphone_names() returns an error with ALSA lib which I assume is because it can't detect a mic.

Why is python unable to detect the mic after the usb port has been attached to the wsl, and what can I do to solve this problem?

Thanks :)

0

There are 0 best solutions below