Skip to content

Instantly share code, notes, and snippets.

@forslund
Last active January 25, 2019 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forslund/98b1db104a20876d055b31b854fa0565 to your computer and use it in GitHub Desktop.
Save forslund/98b1db104a20876d055b31b854fa0565 to your computer and use it in GitHub Desktop.
import pyaudio
pa = pyaudio.PyAudio()
print('\n\n\n==========================================\nFound devices:')
for device_index in range(pa.get_device_count()):
dev = pa.get_device_info_by_index(device_index)
if dev['maxInputChannels'] > 0:
print('{}: Samplerate {} Channels {}'.format(dev['name'],
dev['defaultSampleRate'],
dev['maxInputChannels']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment