FreeDATA/tools/list_audio_devices.py

20 lines
388 B
Python
Raw Normal View History

2021-03-04 14:13:12 +00:00
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import pyaudio
def list_audio_devices():
p = pyaudio.PyAudio()
print("--------------------------------------------------------------------")
devices = [
f"{x} - {p.get_device_info_by_index(x)['name']}"
for x in range(p.get_device_count())
]
2021-03-04 14:13:12 +00:00
for line in devices:
print(line)
2021-03-04 14:13:12 +00:00
list_audio_devices()