python 获取声卡输入输出设备
spooking 归属分类: 开发 评论数: 0 个
import sounddevice as sd


for info in sd.query_devices():
    #windows DirectSound 模式(输出)
    if info['max_output_channels']>0 and info['hostapi']==1:
        print(info['index'],info['name'])
print('----------')
for info in sd.query_devices():
    #windows DirectSound 模式(输入)
    if info['max_input_channels']>0 and info['hostapi']==1:
        print(info['index'],info['name'])