FreeDATA/tools/list_audio_devices.py
Paul Kronenwetter 2fa9aead44 Another round of formatting changes.
Implement class-level logging in places.
2022-05-27 22:17:15 -04:00

19 lines
388 B
Python
Executable file

#!/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())
]
for line in devices:
print(line)
list_audio_devices()