User avatar
MrYsLab
Posts: 449
Joined: Mon Dec 15, 2014 7:14 pm
Location: Noo Joysey, USA

Re: pyAudio Select right input

Wed Oct 17, 2018 9:30 pm

I found the code below here: https://stackoverflow.com/questions/368 ... th-pyaudio.
Perhaps it will help.

Code: Select all

import pyaudio

p = pyaudio.PyAudio()
info = p.get_host_api_info_by_index(0)
numdevices = info.get('deviceCount')
for i in range(0, numdevices):
    if (p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels')) > 0:
        print("Input Device id ", i, " - ", p.get_device_info_by_host_api_device_index(0, i).get('name'))

Return to “Python”