Pythonใจๆจๆบใขใธใฅใผใซpyaudioใ็จใใฆใใชใผใใฃใชใใใคในใฎใคใณใใใฏใน็ชๅทใไธ่ฆงๅๅพใใๆนๆณใใฝใผในใณใผใไปใใง่งฃ่ชฌใใพใใ
ใชใผใใฃใชใใใคในใฎใคใณใใใฏใน็ชๅทใไธ่ฆงๅๅพ
Pythonใงใฏใๆจๆบใขใธใฅใผใซpyaudioใ็จใใใใจใง็ฐกๅใซ้ณๅฃฐใใใคใน๏ผใใคใฏ๏ผใๆไฝใงใใพใใ
ไปๅใฏใใชใผใใฃใชใใใคในใฎใคใณใใใฏใน็ชๅทใไธ่ฆงๅๅพใใฆใฟใพใใใ
๏ผโปใคใณใใใฏใน็ชๅทใฏใใฉใฎใชใผใใฃใชใใใคในใๆไฝใใใใ้ธๆใใใฎใซๅฟ
่ฆ๏ผ
ใฝใผในใณใผใ
ใตใณใใซใใญใฐใฉใ ใฎใฝใผในใณใผใใงใใ
# -*- coding: utf-8 -* import pyaudio import wave def main(): audio = pyaudio.PyAudio() # ้ณๅฃฐใใใคในๆฏใฎใคใณใใใฏใน็ชๅทใไธ่ฆง่กจ็คบ for x in range(0, audio.get_device_count()): print(audio.get_device_info_by_index(x)) if __name__ == '__main__': main()
ๅฎ่กไพ
{'index': 0, 'structVersion': 2, 'name': 'Microsoft ใตใฆใณใ ใใใใผ - Input', 'hostApi': 0, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0} {'index': 1, 'structVersion': 2, 'name': 'ใใคใฏ้ ๅ (Realtek High Definition ', 'hostApi': 0, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.
– | ้ข้ฃ่จไบ |
---|---|
1 | ใPythonใ้ณๅฃฐใปไฟกๅทๅฆ็ๅ ฅ้ |
2 | Pythonๅ ฅ้ ๅบๆฌๆๆณ |
ใณใกใณใ