How to see if there is one microphone active using python?

≡放荡痞女 提交于 2019-12-31 04:11:14

问题


I want to see if there is a microphone active using Python.

How can I do it?

Thanks in advance!


回答1:


Microphones are analog devices, most api's probably couldn't even tell you if there is a microphone plugged in, your computer just reads data from one of your soundcards input channels.

What you probably want to know is if the input channels are turned on or off. Determining that is highly platform specific.




回答2:


This is what I wanted:

import ctypes
from ctypes import *

winmm= windll.winmm
print 'waveInGetNumDevs=',winmm.waveInGetNumDevs()


来源:https://stackoverflow.com/questions/2797572/how-to-see-if-there-is-one-microphone-active-using-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!