Clap detection using your microphone and portaudio.
A clapper based around the PyAudio frontend for PortAudio.
You need portaudio installed, then you can install the latest version pip:
sudo pip install slowclap
It will pull in pyaudio and numpy depenencies.
With default settings, run a shell command of your choosing each time a clap is detected:
slowclap --exec='echo Clap'
You might need to tune the threshold to your mic with the -t option.
Set up a simple detection loop:
import slowclap as sc feed = sc.MicrophoneFeed() detector = sc.AmplitudeDetector(feed, threshold=17000000) for clap in detector: # do something print(clap.time)