Stupid Hackathon: Is it ok to dance?

For this weekend’s Stupid Hackathon, I made Ok2Dance.

Ok2Dance is kind of like Shazam except instead of telling you what music is playing, it analyzes the sound and tells you whether it’s ok for dancing.

Ok2Dance accesses your computer’s microphone to record 20 seconds of audio. It saves the recording (temporarily) as a .wav file. Then it sends that file to the Echo Nest for an in-depth musical analysis. From there, Ok2D will ping Echo Nest continuously for the results of the analysis. Once the analysis is ready, Ok2D converts Echo Nest’s floating point number for danceability to a simpler Yes or No answer. Then it loads a corresponding animated GIF. Then it shows the result, accompanied by the animated GIF.

At this point, the song might be over. But at least you’ll know whether it would have been ok to have danced to that.

Why not try Ok2Dance next time you’re at a club or party and wondering if it’s ok to start dancing? Simply log onto your desktop computer, and point its web browser to jasonsigal.cc/ok2dance/. (**NOTE: Mobile devices do not support getUserMedia, so you must bring a desktop computer!!). If you’re looking for test audio, disco usually is danceable, but the sound of staring blankly into a computer screen usually is not.

You can record anything you want, as many times as you want. And don’t worry about copyright or privacy, because the files are not stored on my server. They’re deleted immediately after the danceability analysis is complete.

Source Code on Github

Leave a Reply

Your email address will not be published.