List all audio devices with Python's pyaudio (portaudio binding)

前端 未结 3 1093
天命终不由人
天命终不由人 2021-02-14 22:37

I tried

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

but I don\'t get th

3条回答
  •  星月不相逢
    2021-02-14 22:57

    I've created (a while after this question was posted) the sounddevice module for Python, which includes its own DLLs with ASIO support (and all other host APIs, too). It can be installed with:

    pip install sounddevice --user
    

    After that, you can list all your devices with:

    python -m sounddevice
    

    Of course you can also do this within Python:

    import sounddevice as sd
    sd.query_devices()
    

提交回复
热议问题