Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Shaq, a CLI for Shazam (yossarian.net)
155 points by woodruffw on Sept 2, 2023 | hide | past | favorite | 35 comments



This is perfect. I've been thinking of setting up a system to automatically record the last couple minutes of every hour of my local NPR station, Shazam the bump music that they play, and post the results as a searchable schedule (since they refuse to do it themselves). I can't tell you how annoying it is to hear like 15 seconds of an interesting song, and have no way of knowing what it is if one's phone can't be reached in time (and to have it happen, like, twice a week).

...If anyone wants to steal this idea and do it themselves, I won't mind.


Pretty handy for dj streams where the dj is unwilling to provide tracklists.


Congrats on the launch!

I've tried doing a similar project too, but never ended up releasing it properly: https://codeberg.org/notpushkin/shazamctl

If you'd like an idea for adjacent project, I was planning to make a menubar app (on macOS) / applet (on Linux) wrapping shazactl after releasing it – I think that might be a nice addition to Shaq, too!


I have needed this so many times in my life! I usually run a virtual audio device router like Loopback or Soundflower or Background Music. It's so janky.


I’ve wanted something like this to scrobble vinyl forever. This cat gets it!


I don't know why, but Shazam has been really hit or miss lately. I've always managed to get sources for obscure elevator songs that would pop up but now it's failing to pick up the simplest stuff. I've since then switched to Google assistant which can get the song right in 3 seconds or less and with much more consistency. It's a shame because it's just one of those apps I thought was groundbreaking when I first started using it.


Wasn't very straight forward in the readme, but is it possible to listen directly from Firefox or even more ideally the sound from the whole computer?

Shazam already has a desktop app that can listen to your ambient sound in your room from the microphone.


The blog post explains that the goal is to run this on a SBC that’s connected directly to my sound system. I don’t always have my computer turned on, or have Firefox open.


If you have Nix and want to test this without python versions, pip, whatnot you can use `nix run github:figsoda/nixpkgs/shaq#shaq -- --listen` or `nix shell github:figsoda/nixpkgs/shaq#shaq` and use `shaq` in your temp shell.

Or, once this @figsoda PR[0] gets merged and it gets in the nixpkgs unstable you can use `nix run nixpkgs#shaq -- --listen` or `nix shell nixpkgs#shaq` instead.

[0] https://github.com/NixOS/nixpkgs/pull/253135


Related: songrec. Similar tool, written in Rust. Haven't used shaq yet but it seems simpler?

https://github.com/marin-m/SongRec


If you're wondering how to implement Shazam itself, it's surprisingly straightforward using a notion of "anchor points" and "constellations" within a spectogram to reduce the search space and be resistant to ambient noise.

https://ismir2003.ismir.net/presentations/Wang.pdf

https://www.princeton.edu/~cuff/ele201/files/Wang03-shazam.p...

At scale, you just need a really fast key-value lookup table - and of course, the legal permissions for all the audio files. But if you have a proprietary set of audio files you want to be able to match ambient audio recordings against, it's absolutely feasible to implement from scratch.

https://stackoverflow.com/questions/6269167/open-source-audi... has a number of open-source solutions using similar approaches.


Implementing something like Shazam that works in a quiet room with perfect source might be "straight forward" and "just need a really fast key-value table" but the thing where Shazam shines is doing all of that with very quiet audio, bad quality, noisy background and all kinds of other non-lab conditions.

I think you are underselling the engineering effort a bit there, I'm sure the engineers working on it for years have a reason for still being there.


The fingerprinting algorithm described in the paper handles noise and quality issues - it’s not just for lab environments. That said there are many parameters that can be tuned from real-world data, additional filters that can be applied, and no doubt Shazam has improved things over the years.

With regards to engineering, I believe the lion’s share of Shazam’s engineering goes to things other than the core algorithm: app development, song ingestion pipelines, enterprise analytics for the record industry, etc.


For anyone else reading the term scrobbler for the first time:

> scrobble: verb. (of an online music service) to record (a listener's musical preferences) and recommend similar music that he or she might enjoy.

Source: https://www.collinsdictionary.com/dictionary/english/scrobbl...

Curious to know if there's an equivalent for video games.


Seems to me that Steam itself fits well into this category. It tracks your overall play time for games and has a recommender system, and also keeps global stats for a _lot_: https://store.steampowered.com/charts/


Apple hasn't stopped people from just using the shazam API? Damn, I hope this lasts forever.

I had been looking for an open source shazam-like for a while before giving up and just installing the app under a work-profile on my phone.


They have a webapp you can run in its own sandbox.


Cool. I only got it to appear when I opened the site in my phone's web browser. Desktop just directs to the app.

Also learned from the website, something called shazamkit exists for official developer use. cool.


I wonder — is the name a reference to the mass confusion about “Shazam” starring Sinbad and “Kazam” starring Shaquille O’Neal? Or an example of it?



Totally. Classic/legendary example of Mandela Effect


The kerning in the prompt between the @ and the j is really unfortunate



Quite appreciate the naming of this project


I hope people get the reference to the Kazam movie starring Shaq.


Incredible name.


What is amazing about it, too, is that if you want to get better at using Shaq you could “increase your Shaq-fu”. For those who aren’t aware, there was a 2D fighting game released in the 1990s called Shaq Fu and featured Shaq [0]

[0] https://en.m.wikipedia.org/wiki/Shaq_Fu


I hate it. Something magic related would have been so much better. Like “wand” or “tophat”.


Shaq played a genie in the movie Kazaam :D


Shaq starred in 'Kazam'. Perhaps 'Sinbad cli'? Cool project!



Is it me or Shazam keep degrading in actual recognition performance?


I'll admit I don't use it all too much, but it has picked up almost every song I've tried it on over the last couple of months (14) - from video game soundtracks to a song echoing through a stadium.


Yes, I used it very frequently for years. Multiple times a week. This year I began looking for alternatives because Shazam has become so unreliable for me.


Has been fine for me




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: