My dog Oliver has always been quite vocal, and recently I decided that his thoughts and comments needed to be shared with the world. Thus the @OliverBarkBark project was born. By connecting a Rasberry Pi, a wifi dongle, and a microphone, I was able to make a system that automatically detected, filtered, and published each and every one of Oliver’s deafening vocalizations.
The full process from bark to tweet takes three steps. First is recording. I have the raspberry pi listening continuously and triggering a recording once it hears a sound over a preset volume. Oliver barking is by far the loudest thing within several miles, so the volume threshold should be sufficient. However, the recordings are still triggered occaisonally by unwanted junk. To gaurd against this, I needed to perform a second step to filter the barks from the junk.
I took a machine learning approach to filter out the barks. I built a model using the pyAudioAnalysis library and around a day’s worth of barks (about 20). I then set up a bash script to run every ten minutes, classify each recorded sound, and forward the barks on to the next step.
Finally, the barks are forwarded to the twitter api (using python-twitter) and posted under the handle @OliverBarkBark (be sure to follow!). Currently the tweets are random strings composed of “bark,” “ruff,” and “woof.” I plan to replace that with a bark-to-text translator that will likely produce similar results but be more accurate to Oliver’s actual voice.
Check out all the code: https://github.com/HenryWConklin/barkdetect
Next step: weekly podcasts.
Thisis so awesome! I'm always looking for fun things to do with my pi.