Is it possible to detect whether or not something is plugged into the audio jack, in python?
-
29-10-2019 - |
Question
I'm trying to detect if there is a device hooked into the audio jack with python. This is in Windows 7.
Solution
see https://superuser.com/questions/110933/how-does-a-sound-card-determine-if-headphones-are-plugged-in
The answer is: It depends on your hardware. I have not seen any operating system detect headphones in the past decade, but some cheap soundcards do support it. (edit: According to Larry Osterman's comment, they are now standard.)
If your soundcard supports it, I believe you will find the following to be the answer you are looking for: Detecting when head phones are plugged in (python will probably need to ask some system API)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow