Skip to content

Instantly share code, notes, and snippets.

@curzona
Created December 4, 2015 02:02
Show Gist options
  • Save curzona/d2c604509cd094a3558b to your computer and use it in GitHub Desktop.
Save curzona/d2c604509cd094a3558b to your computer and use it in GitHub Desktop.
import pyaudio
p = pyaudio.PyAudio()
for i in range(p.get_device_count()):
print p.get_device_info_by_index(i)
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.09, 'defaultLowInputLatency': 0.09, 'maxInputChannels': 2L, 'structVersion': 2L, 'hostApi': 0L, 'index': 0, 'defaultHighOutputLatency': 0.18, 'maxOutputChannels': 0L, 'name': u'Microsoft Sound Mapper - Input', 'defaultHighInputLatency': 0.18}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.09, 'defaultLowInputLatency': 0.09, 'maxInputChannels': 2L, 'structVersion': 2L, 'hostApi': 0L, 'index': 1, 'defaultHighOutputLatency': 0.18, 'maxOutputChannels': 0L, 'name': u'Microphone (4- Logitech G930 He', 'defaultHighInputLatency': 0.18}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.09, 'defaultLowInputLatency': 0.09, 'maxInputChannels': 0L, 'structVersion': 2L, 'hostApi': 0L, 'index': 2, 'defaultHighOutputLatency': 0.18, 'maxOutputChannels': 2L, 'name': u'Microsoft Sound Mapper - Output', 'defaultHighInputLatency': 0.18}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.09, 'defaultLowInputLatency': 0.09, 'maxInputChannels': 0L, 'structVersion': 2L, 'hostApi': 0L, 'index': 3, 'defaultHighOutputLatency': 0.18, 'maxOutputChannels': 2L, 'name': u'Speakers (4- Logitech G930 Head', 'defaultHighInputLatency': 0.18}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.09, 'defaultLowInputLatency': 0.09, 'maxInputChannels': 0L, 'structVersion': 2L, 'hostApi': 0L, 'index': 4, 'defaultHighOutputLatency': 0.18, 'maxOutputChannels': 2L, 'name': u'Digital Audio (S/PDIF) (2- High', 'defaultHighInputLatency': 0.18}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.09, 'defaultLowInputLatency': 0.09, 'maxInputChannels': 0L, 'structVersion': 2L, 'hostApi': 0L, 'index': 5, 'defaultHighOutputLatency': 0.18, 'maxOutputChannels': 2L, 'name': u'Digital Audio (S/PDIF) (2- High', 'defaultHighInputLatency': 0.18}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment