Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to detect whether or not something is plugged into the audio jack, in python?

I'm trying to detect if there is a device hooked into the audio jack with python. This is in Windows 7.

like image 402
rectangletangle Avatar asked Dec 01 '25 03:12

rectangletangle


1 Answers

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)

like image 149
ninjagecko Avatar answered Dec 03 '25 18:12

ninjagecko