最後活躍 1729044033

Darvyn's Avatar xavieryang 已修改 1729044033. 還原成這個修訂版本

1 file changed, 15 insertions

check_audio_device_id.py(檔案已創建)

@@ -0,0 +1,15 @@
1 + import pyaudio
2 +
3 + def list_audio_devices():
4 + p = pyaudio.PyAudio()
5 +
6 + print("Available audio devices:")
7 + for i in range(p.get_device_count()):
8 + device_info = p.get_device_info_by_index(i)
9 + # 只打印输出设备
10 + if device_info['maxOutputChannels'] > 0:
11 + print(f"Device ID: {i}, Name: {device_info['name']}, Max Output Channels: {device_info['maxOutputChannels']}")
12 +
13 + p.terminate()
14 +
15 + list_audio_devices()
上一頁 下一頁