CoolFace
Apppublic

Coder19/interview_system

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
new.py20 linesDownload Raw Back to root
1import pyaudio2 3p = pyaudio.PyAudio()4 5for i in range(p.get_device_count()):6    dev = p.get_device_info_by_index(i)7    print(f"\nDevice {i}: {dev['name']}")8    try:9        if p.is_format_supported(10            rate=16000,11            input_device=dev['index'],12            input_channels=1,13            input_format=pyaudio.paInt1614        ):15            print("✔ 16000 Hz is supported")16        else:17            print("✘ 16000 Hz is not supported")18    except Exception as e:19        print("✘ Error:", e)20