![]() You can use the code below to display the MPS of a sound file. We’re going to be using the mel power spectrogram (MPS), which is like a spectrogram with additional transformations applied on top of it. Low-pitched sounds are at the lower end of the y-axis and high-pitched sounds are on the upper end, while the color represents the intensity of the sound. You can also simply think of it as taking the waveform of an audio file and creating a simple heat map over time and audio frequencies (Hz). ![]() If you’ve never played with sounds before, you can head over to Wikipedia to read about what a spectrogram is. I extracted the audio from a particular highlight and used librosa, a library for audio and music analysis, to do some simple signal processing. The Habs’ website has a listing of all previous games with ~4 minutes video highlights of each game. The first step is to take a look at what a goal sound looks like. By hooking up into the audio feed of the game and processing it in real-time using a machine learning model trained to detect when a goal occurs, we could trigger the lights and music automatically, allowing all the spectators to dance and do celebratory chest-bumps without having to worry about pushing a button. There is of course the goal horn, if the home team scores, but also the commentator who usually yells a very intense and passionate “ GOOOAAAALLLLL!!!!!”. Imagine you watch a hockey game blindfolded, I bet you would have no problem knowing when goals are scored because a goal sounds a lot different that anything else in a game. That is already pretty cool, but can we take it one step further? Wouldn’t it be better if the celebratory sequence could be triggered automatically?Īs far as I could find, there is no API or website available online that can give me reliable notifications within a second or two that a goal was scored. Everything would be triggered using a big Griffin PowerMate USB button that would need to be pushed by whoever was the closest to it when the goal occurred. The original goal (no pun intended) of this hack was to program a celebratory light show using Philips hue lights and play the Habs’ goal song when they scored a goal. A full architecture diagram is available if you want to follow along. The rest of this post explains each step that was involved in putting this together. In a single sentence, I trained a machine learning model to detect in real-time that a goal was just scored by the Habs based on the live audio feed of a game and to trigger a light show using Philips hues in my living room. Even most of those who don’t normally care the least bit about hockey transform into die hard fans of the Montréal Canadiens, or the Habs like we also call them.īelow is a Youtube clip of the epic goal celebration hack in action. In Montréal this time of year, the city literally stops and everyone starts talking, thinking and dreaming about a single thing: the Stanley Cup Playoffs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |