shubhamjain / earphone-event

Module to detect earphone button click and hold

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Earphone Events

This is a small module which can be used to detect earphone button presses. I was aroused by curiousity on how these buttons worked. I hacked around and found, they emit a certain noise like this. So there went my afternoon to detect the clipping part and make the button presses meaningful. It is explained more succintly in my blog post

How can this be used?

I originally made it to control VLC player from button presses but the module is of feeble use, as of now. For using this, you must have a way detect the noise, implying you have a machine with a combo jack [mic + headphone combined jack]. Secondly, I have only tried my pair of samsung earphones; I am not sure how the other pairs would work on this. The example.py shows an example on using the module.

About

Module to detect earphone button click and hold

License:MIT License


Languages

Language:Python 100.0%