Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想看看是否有一个使用 Python 的麦克风处于活动状态。
我该怎么做?
提前致谢!
麦克风是模拟设备,大多数 api 可能甚至无法告诉您是否插入了麦克风,您的计算机只是从您的声卡输入通道之一读取数据。
您可能想知道输入通道是打开还是关闭。确定这是高度特定于平台的。
这就是我想要的:
import ctypes from ctypes import * winmm= windll.winmm print 'waveInGetNumDevs=',winmm.waveInGetNumDevs()