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

前端 未结 2 525
你的背包
你的背包 2021-01-24 08:57

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

How can I do it?

Thanks in advance!

相关标签:
2条回答
  • 2021-01-24 09:49

    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.

    0 讨论(0)
  • 2021-01-24 09:57

    This is what I wanted:

    import ctypes
    from ctypes import *
    
    winmm= windll.winmm
    print 'waveInGetNumDevs=',winmm.waveInGetNumDevs()
    
    0 讨论(0)
提交回复
热议问题