1

I was looking through PyAudio documentation and i found these two methods:

1: info.get('deviceCount')
2: p.get_default_input_device_info()

Which returns:

output 1: 3
output 2: IOError

My pc currently has no microphones plugged but has 3 speakers.

Is there a way to check for available microphones returning a zero instead of an IO error with pyaudio?

1 Answers1

0

I got it by doing this:

p = pyaudio.PyAudio()
try:
    print(p.get_default_input_device_info())
except:
    print("No mics availiable")

output: No mics availiable