News for hackers. Stuff that matters.
Re:Apple has completed its acquisition of Shazam by SmellyGeekBoy on Tuesday September 25, 2018 @11:06AM (#18066897)
Shazam is the closest thing we have to witchcraft. I'm sure plenty of HNers will chime in with "well acktually..." type comments about how they could write it in their basement in a weekend, but to do what it does, as quickly as it does, on the ridiculously enormous library of music that it does is really something special.
Re:Apple has completed its acquisition of Shazam by cannam on Tuesday September 25, 2018 @12:06PM (#18067574)
I agree with you, and I work in music audio signal processing.

Shazam was founded in 1999-2000 ish and was live by 2002, longer ago than many people realise. The fingerprinting method they used was a novel one, and they successfully deployed it in a couple of years, with a database of two million tracks, in a system that could be used by dialling a number from any phone. It's an extraordinary and rare example of taking a research method and getting it to work at scale in the face of real constraints, in the process producing something that most people would never have imagined could be done.

Re:Apple has completed its acquisition of Shazam by 3pt14159 on Tuesday September 25, 2018 @03:45PM (#18069835)
I was surprised that they didn't use a Jaccard distance when I looked into the paper, but I never really tested out why their more complicated method was required. The core insight (that note timing / beat is a fingerprint) is money, but the rest of the math seemed unnecessarily complicated.

Would really be interested if someone has tried other approaches and can comment.

Re:Apple has completed its acquisition of Shazam by kidsnow on Tuesday September 25, 2018 @12:37PM (#18067884)
THAT is the kind of startup I wish I could work for.
Re:Apple has completed its acquisition of Shazam by meowface on Tuesday September 25, 2018 @03:25PM (#18069621)
Me too. Are there any similar startup with functional prototypes or products? Something like Shazam, or Theranos if it were actually legitimate and had a working product.
Re:Apple has completed its acquisition of Shazam by acjohnson55 on Tuesday September 25, 2018 @10:14PM (#18072160)
Echo Nest was like them, but they got gobbled up by Spotify several years ago.
Re:Apple has completed its acquisition of Shazam by someguy101010 on Tuesday September 25, 2018 @03:35PM (#18069732)
ipfs?
Re:Apple has completed its acquisition of Shazam by jciochon on Tuesday September 25, 2018 @05:00PM (#18070430)
SoundHound would fit the bill.
Re:Apple has completed its acquisition of Shazam by innagadadavida on Tuesday September 25, 2018 @04:12PM (#18070080)
Philips had similar technology that predates Shazam. That said, Shazam's algorithm scales better as they use "combinatorial hashing". This coupled with the fact they can up the hashes in a key-value table makes them better.
Re:Apple has completed its acquisition of Shazam by cannam on Wednesday September 26, 2018 @04:13AM (#18073829)
For anyone else still reading, this paper from Philips Research describes the method I think you're referring to. (It's cited in Avery Wang's 2003 Shazam paper.) http://www.ismir2002.ismir.net/proceedings/02-FP04-2.pdf

This is a really nice paper as well, but the Shazam method is more exciting because of its focus on the search part of the problem. Audio fingerprinting wasn't an entirely new field of course - the Philips paper also cites several prior publications.

The big limitation of all these methods is that they are robust to EQ and other degradations but not at all to variations in timing between frames. So they work well for identifying different instances of the same recording, but not at all for matching different performances, or for "query-by-humming".

Re:Apple has completed its acquisition of Shazam by henrik_w on Tuesday September 25, 2018 @11:24AM (#18067094)
Here is a good write-up on how it works:

http://coding-geek.com/how-shazam-works/

Re:Apple has completed its acquisition of Shazam by vernie on Tuesday September 25, 2018 @11:56AM (#18067463)
Here's some code that strips down a song to its Shazam-able fingerprint:

https://github.com/jvbalen/soundofshazam/blob/master/sound_o...

And an example output (try Shazam-ing it!):

https://soundcloud.com/sample_noise/shazuffle-ii-shazam-me

Re:Apple has completed its acquisition of Shazam by saganus on Tuesday September 25, 2018 @03:41PM (#18069801)
And here's a Java project with similar functionality (although I'm not sure it will have near the same accuracy). [0]

He also got some legal threats just for publishing code he created himself.

[0] http://royvanrijn.com/blog/2010/06/creating-shazam-in-java/

Re:Apple has completed its acquisition of Shazam by QasimK on Tuesday September 25, 2018 @11:58AM (#18067489)
Absolutely fascinating, it covers so much breadth too!
Re:Apple has completed its acquisition of Shazam by captainmuon on Tuesday September 25, 2018 @01:20PM (#18068341)
After I learned how it roughly works, it seems no longer like witchcraft, but it is still impressive.

The remaining thing I don't understand now is how the heck they managed to negotiate the license for all the songs they have in the database. A friend of mine had a major website for lyrics, and he got some legal trouble from the record companies. When he tried to buy a license to display the lyrics, after some back and forth, they basically said they're not interested in licensing. This was in the early 2000s before streaming took off. Since that time I have the impression that often legal and social problems are much harder to solve than technological ones.

Re:Apple has completed its acquisition of Shazam by samstave on Tuesday September 25, 2018 @01:59PM (#18068791)
They are likely able to show that the DB is comprised of simply the fingerprints, and not the full songs - thus they wouldnt be able to "use" the DB to profit from play-back of the songs it can identify.
Re:Apple has completed its acquisition of Shazam by tw04 on Tuesday September 25, 2018 @12:03PM (#18067547)
I mean, given that Google still can't even get close, I'd be inclined to tell every last one of them they're full of it.

I actually bought Shazam on android after repeated attempts at getting google to find music in the same way - they're laughably bad.

Re:Apple has completed its acquisition of Shazam by notatoad on Tuesday September 25, 2018 @12:08PM (#18067589)
my recent experience with shazam is that it's much less accurate than Google when picking out random background music from a noisy area.

that said, i still prefer shazam because it's an actual app, whereas google's implementation is a button that sometimes appears in the google app, and sometimes doesn't, seemingly at random.

Re:Apple has completed its acquisition of Shazam by watty on Tuesday September 25, 2018 @11:20AM (#18067028)
I don't mean to take away from Shazam (because I too was amazed when I first used it) but the Pixel phones have Shazam-like ability built in which uses minimal battery and without internet... and it's constantly running any time music plays.

Not really "magic" how it works but still pretty amazing that I can pull the phone out of my pocket any time I hear a song I like and immediately see the band/title.

Re:Apple has completed its acquisition of Shazam by hanoz on Tuesday September 25, 2018 @11:35AM (#18067245)
> without internet

For anyone else finding this as implausible as I was, apparently the Pixel has a local database of 17,300 tracks. Still pretty impressive though.

https://uk.pcmag.com/news/91606/googles-pixel-2-phones-recog...

Re:Apple has completed its acquisition of Shazam by gregknicholson on Tuesday September 25, 2018 @11:31AM (#18067184)
> Pixel phones have Shazam-like ability built in which uses minimal battery and without internet... and it's constantly running any time music plays.

Is it on by default? Cos that sounds really creepy.

Re:Apple has completed its acquisition of Shazam by ProAm on Tuesday September 25, 2018 @11:38AM (#18067278)
Shazam is also on by default [1] , so they are both creepy

[1] https://motherboard.vice.com/en_us/article/8q8ee3/shazam-kee...

Re:Apple has completed its acquisition of Shazam by zwily on Tuesday September 25, 2018 @12:43PM (#18067952)
The Mac app is, which I didn't even know existed.
Re:Apple has completed its acquisition of Shazam by matthewmacleod on Tuesday September 25, 2018 @02:29PM (#18069071)
To stress the point, this feature uses a local database, doesn't send any data off of the device, and is turned off by default.
Re:Apple has completed its acquisition of Shazam by notatcomputer68 on Tuesday September 25, 2018 @03:37PM (#18069761)
Imo the creepy thing is that phones are now powerful enough to run always on analysis, not that they are currently doing anything malicious with it.
Re:Apple has completed its acquisition of Shazam by kidsnow on Tuesday September 25, 2018 @12:41PM (#18067927)
Coming soon, Pixel will be able to recognize over 1 million individual voices in your area! Using our enormous database of phone calls to your area code and individualized location tracking, you will be able to find out everything about a person simply by holding your phone near their voice!
Re:Apple has completed its acquisition of Shazam by bradstewart on Tuesday September 25, 2018 @11:36AM (#18067261)
No, it's not.
Re:Apple has completed its acquisition of Shazam by mcphage on Tuesday September 25, 2018 @11:31AM (#18067185)
> and without internet

That's really sweet—I wonder how much storage that requires? I would have expected it to require a lot, but if it's on a phone, then maybe not that much?

Re:Apple has completed its acquisition of Shazam by icebraining on Tuesday September 25, 2018 @11:34AM (#18067231)
The database holds fingerprints for ~17000 songs and takes 53MBs: https://www.xda-developers.com/google-pixel-2-now-playing-so...
Re:Apple has completed its acquisition of Shazam by mrguyorama on Tuesday September 25, 2018 @01:35PM (#18068519)
They should allow you to download databases based on things like genre. The 64gb Pixel could hold a very very large amount
Re:Apple has completed its acquisition of Shazam by mcphage on Tuesday September 25, 2018 @11:58AM (#18067488)
Thanks—that's crazy awesome :-)
Re:Apple has completed its acquisition of Shazam by emodendroket on Tuesday September 25, 2018 @11:23AM (#18067075)
They do? I use a Pixel 2 XL and I had no idea about this.
Re:Apple has completed its acquisition of Shazam by ariwilson on Tuesday September 25, 2018 @11:28AM (#18067148)
Re:Apple has completed its acquisition of Shazam by emodendroket on Tuesday September 25, 2018 @02:43PM (#18069209)
Neat.
Re:Apple has completed its acquisition of Shazam by kevin_thibedeau on Tuesday September 25, 2018 @01:01PM (#18068141)
Google used to have song identification via voice search and a widget on all Android phones since Lollipop. Then they killed it for no reason other than to screw over existing users. Widget is still there in Nougat but doesn't do anything.
Re:Apple has completed its acquisition of Shazam by sorenjan on Tuesday September 25, 2018 @01:49PM (#18068685)
They recently updated the music search. It's integrated in their assistant, and they have a widget for direct access.

https://ai.googleblog.com/2018/09/googles-next-generation-mu...

Re:Apple has completed its acquisition of Shazam by ChrisArchitect on Tuesday September 25, 2018 @03:02PM (#18069380)
what, the functionality is still there in Nougat, I access it mostly through the assistant which is good enough to detect a song is playing and suggest What is this song? and has great accuracy
Re:Apple has completed its acquisition of Shazam by busterarm on Tuesday September 25, 2018 @11:10AM (#18066937)
Maybe my listening tastes are just _that weird_, but I've found that it's only accurate about 50% of the time for those times when I really need it.

It's also pretty garbage for classical music.

Re:Apple has completed its acquisition of Shazam by cwilkes on Tuesday September 25, 2018 @11:23AM (#18067078)
I haven’t had it misidentify anything — it just won’t identify a song. Granted I do this when in a public place and usually it is something like a piano rendition of another song. I really can’t blame it for not being able to hear the music as it is hard for me to.
Re:Apple has completed its acquisition of Shazam by bluetidepro on Tuesday September 25, 2018 @11:08AM (#18066919)
Agreed 100%. It's the one app that truly does feel magical to me. And it still impresses people I show who don't use it regularly when we are out somewhere and they ask the age old "what song is this?" Pull out my phone, click one button, and in less than 5 seconds it's there. Blows my mind every-time.
Re:Apple has completed its acquisition of Shazam by justifier on Tuesday September 25, 2018 @03:54PM (#18069922)
even more mystic in its infancy when it was an abbreviated phone number you would call, hold up the phone mic near the source, get hung up on and then recieve a txt with your song title and artist.. in 2002

(o) https://en.wikipedia.org/wiki/Shazam_%28application%29#Early...

Re:Apple has completed its acquisition of Shazam by on_and_off on Tuesday September 25, 2018 @04:26PM (#18070205)
Soundhound is pretty great too !

I have worked on integrating a shazam like library inside an app. We have looks at more than 12 solutions before finding a company with a song recognition library good enough to be called shazam like. It is by no mean a small feat you can reproduce during a weekend.

Re:Apple has completed its acquisition of Shazam by tootie on Tuesday September 25, 2018 @04:03PM (#18069993)
I mean, it's never worked for me even once that I can recall. I've mostly tried to identify music playing in commercial spaces (retail, cafes, etc) via Siri and I don't think it's ever given me an answer.
Re:Apple has completed its acquisition of Shazam by amelius on Tuesday September 25, 2018 @12:33PM (#18067829)
My data point: I often go to parties where they play African and world music. Shazam fails more often than not ...

The interesting thing is: most of these songs are on YouTube, so in theory Google could build a better Shazam.

Re:Apple has completed its acquisition of Shazam by nerdnumerouno on Tuesday September 25, 2018 @12:36PM (#18067864)
Exactly! Maybe if you listen to the billboard hits you'll always find a match, but IME it rarely matches the songs I actually don't know and can't find details on.
Re:Apple has completed its acquisition of Shazam by gnulinux on Tuesday September 25, 2018 @11:47AM (#18067374)
Ooook I don't want to be that guy, but if you take a signal processing course in a university, you'd see that algorithms that Shazam probably uses aren't blackmagic. In UC Berkeley one of the projects we did in our Linear Algebra class was doing something like Shazam; the input was a 5 seconds of a random song tuned down so much that human hear can barely hear and white noise added. Then the problem is matching this record with the song and specify start and end time (e.g. 2:30 to 2:35). Shazam is probably much more complex than this (I don't use it) but if college freshmen can do this...
Re:Apple has completed its acquisition of Shazam by pfarrell on Tuesday September 25, 2018 @02:33PM (#18069125)
I worked in email marketing where at its core, we were just doing string replacement from database lookups. Now, we did those string replacements over 300 million times a day. As my boss said "Everything at scale is hard".
Re:Apple has completed its acquisition of Shazam by wrigby on Tuesday September 25, 2018 @01:07PM (#18068217)
I only have a cursory knowledge of DSP, but it sounds like this was implemented by using the 5 second clip to build a matched filter kernel. This would require convolving the samples of the 5 second clip with the entire song to find out where it matches, which should work super well, but I think it would be really tough to scale this up to millions of songs. Is this how it was implemented?
Re:Apple has completed its acquisition of Shazam by vernie on Tuesday September 25, 2018 @11:50AM (#18067403)
Pedant baited.
Re:Apple has completed its acquisition of Shazam by dang on Tuesday September 25, 2018 @02:43PM (#18069206)
Please don't be a jerk on HN, even if another comment seems a bit pedantic.

Separately: there was nothing wrong with gnulinux's comment. It was obviously posted for the pleasure of sharing information, and didn't put down either the GP or Shazam.

Re:Apple has completed its acquisition of Shazam by gnulinux on Tuesday September 25, 2018 @11:59AM (#18067501)
Why can't I delete comments in HN? If from the responses to my comment I learned that I add nothing to do conversation, I want to be able to delete my comments. Am I missing something?
Re:Apple has completed its acquisition of Shazam by gknoy on Tuesday September 25, 2018 @12:29PM (#18067795)
For what it's worth, I think it's neat that you shared that the knowledge necessary to build a Shazam-like thing is something an undergraduate might do as a homework assignment. I had thought it would be a lot more complicated. :)
Re:Apple has completed its acquisition of Shazam by gnulinux on Tuesday September 25, 2018 @12:35PM (#18067857)
If you're interested, you can search Berkeley EE16A and if you're lucky you'll find the homework assignment (Berkeley's class materials are always open to public). It was like a Jupyter notebook and the "song" was I think random 5 seconds of Universal Declarations of Human Rights, or something like that. I'm writing this in case it helps your search, I'm at work so I don't have time to search it myself. I took this class a while ago and am alumni so my memory is fuzzy about the details of this assignment.
Re:Apple has completed its acquisition of Shazam by applecrazy on Tuesday September 25, 2018 @02:20PM (#18068992)
The course website for EE16A is https://inst.eecs.berkeley.edu/~ee16a/. Looks like an interesting course.
Re:Apple has completed its acquisition of Shazam by gnulinux on Wednesday September 26, 2018 @09:48AM (#18075865)
It's mostly pretty standard linear algebra (from matrix operations to vector spaces to eigenvalue/eigenvectors) and some circuit theory (KVL, KCL, op-amps, circuit design etc) and some signal processing (cross-correlation, OMP, Sparse OMP, least squares etc). All EE/CS students take this class in Berkeley, it is strongly recommended to be taken as freshman (unless you take Math 54 which is an equivalent course with no circuit theory). It is followed by EE16B which includes further topics in linear algebra (SVD!), circuits (transistors!) and signal processing (Fourier Series!), and CS70 which includes discrete mathematics and probability theory. This series is usually taken along with programming based classes CS 61A and CS 61B; and after finishing both of these series students start taking "upperdivision" classes.
Re:Apple has completed its acquisition of Shazam by jakobegger on Tuesday September 25, 2018 @12:36PM (#18067866)
I think you have a few minutes to delete comments, but as soon as someone replies to you that link goes away.

I think it's a good thing, because often there are good comments in response to downvoted comments. Letting people delete comments would make the discussion hard to follow.

Re:Apple has completed its acquisition of Shazam by libria on Tuesday September 25, 2018 @12:44PM (#18067963)
You don't have to, the votes will gradually adjust comment visibility based on its perceived (de)merit. Besides, an unpopular comment doesn't mean it's incorrect, e.g. the content might be useful but the tone irritating.

It was informative to myself at least.

Re:Apple has completed its acquisition of Shazam by brazzledazzle on Tuesday September 25, 2018 @11:21AM (#18067050)
I think the “actually” makes it even better. Even if the underlying technology isn’t anything truly special the application of it is pretty clever.
Re:Apple has completed its acquisition of Shazam by Timmah on Tuesday September 25, 2018 @11:14AM (#18066974)
It creates a time series of frequencies then checks a db for that same series. A problem that is easily parallelizable. Probably does some filtering first. It's a very useful and clever application, but not that technically challenging. The most amazing feat is they got access to the catalogs of the record labels.

I wish someone would do the same thing for commercials on TV. Auto detect the commercial and advance the DVR by its exact duration

Re:Apple has completed its acquisition of Shazam by icebraining on Tuesday September 25, 2018 @11:22AM (#18067068)
Re:Apple has completed its acquisition of Shazam by h1srf on Tuesday September 25, 2018 @02:24PM (#18069026)
> I wish someone would do the same thing for commercials on TV. Auto detect the commercial and advance the DVR by its exact duration

They've had it for years now. I was skipping commercials on my HTPC back in 2007-ish. I think the older Tivo's also had this ability.

Re:Apple has completed its acquisition of Shazam by akhilcacharya on Tuesday September 25, 2018 @11:21AM (#18067055)
Aren't most commercials sold in 30-60 second blocks?
Re:Apple has completed its acquisition of Shazam by Timmah on Tuesday September 25, 2018 @11:42AM (#18067314)
Yeah. So if you skipped 60 seconds on a 30 second commercial you'd cut into your program. Hence the identification requirement.
Re:Apple has completed its acquisition of Shazam by dylan604 on Tuesday September 25, 2018 @12:16PM (#18067669)
That's why TIVO (or whichever DVR company) had the skip 30 seconds button. If it was a 60, you hit it twice. However, they also sell 15 second blocks. Now, it's just fast forward at ludicrous speeds.
Re:Apple has completed its acquisition of Shazam by Jyaif on Tuesday September 25, 2018 @11:17AM (#18067001)
Yes shazam's algorithm is aktually pretty simple math, but there's nothing wrong with creating a busines sbased on simple tech! Like most companies in tech, it's the business part that is hard, not the technical part.
Re:Apple has completed its acquisition of Shazam by Cthulhu_ on Tuesday September 25, 2018 @11:25AM (#18067103)
When Twitter came out I was like "well it's a glorified shoutbox, I can hack that in an afternoon". Actually it still is, any developer can create a Twitter clone in hours. However Twitter managed to have the network effect, and (eventually) solve the huge scaling challenge that a system that transfers billions (?) of messages worldwide every day.
Re:Apple has completed its acquisition of Shazam by Jyaif on Tuesday September 25, 2018 @11:38AM (#18067276)
Twitter is hard to scale, you have to make trade-offs all over the place.

AFAIK that's not the case of Shazam where a read-only database would be enough. Sure eventually you have to manage multiple versions of your app and be able to gradually update your DB, but that's still simple stuff compared to the problem of how to make money.

Re:Apple has completed its acquisition of Shazam by jonwachob91 on Tuesday September 25, 2018 @11:08AM (#18066925)
>> Shazam is the closest thing we have to witchcraft.

I've never used Shazam, but I used a similar feature on my LG Chocolate back in the day. How is Shazam any different than what my LG Chocolate did (aside from the Spotify integration)?

Re:Apple has completed its acquisition of Shazam by lobo_tuerto on Tuesday September 25, 2018 @11:12AM (#18066953)
I don't understand why you do expect others to know about that when Shazam is ubiquitous and you haven't bothered to try it yet. See for yourself.

Expecting people to know how is it different from an LG Chocolate is just absurd...

Re:Apple has completed its acquisition of Shazam by icebraining on Tuesday September 25, 2018 @11:19AM (#18067025)
Apparently Verizon's LG Chocolate came with a service called VCast Song ID, that did the same thing as Shazam: "On certain phones, users can record a 10-second clip of a song, have it automatically identified, and optionally buy a copy of it for playback on a phone or computer." (https://www.digitaltrends.com/mobile/name-that-tune-with-ver...)

That said, Shazam is actually older, having started as a shortcode service in the UK way back in 2002.

Re:Apple has completed its acquisition of Shazam by chrisfinazzo on Tuesday September 25, 2018 @11:33AM (#18067219)
I am equal parts amazed and horrified when I hear that some app started out as an MMS hack on feature phones. Dictionary lookups, directions, and multimedia, all on "candybars". It's one area the US never really got behind and jumped straight to smartphones and discrete apps.

How exactly did this come to be?

That's the anthology I want to read.

Re:Apple has completed its acquisition of Shazam by avip on Tuesday September 25, 2018 @11:11AM (#18066945)
Well acktually, in my admittedly limited experience, Shazam is not capable of recognizing any music at all without the digitized metadata encoded with sound files. I've tried multiple times to sing very popular songs to it. It never recognized them. You could attribute it to my poor musical skills (and I'm fine with that), but 100% of humans would recognize the songs in < 10s timeframe.
Re:Apple has completed its acquisition of Shazam by smoe on Tuesday September 25, 2018 @11:38AM (#18067281)
As far as I know, the way Shazam uses fingerprints it is not supposed to recognize any song this way. Or even when a cover or a live version of a song is played.

I remember Adam Neely (A musician/jazz composer/youtuber) mentioning in a Q&A, that for songs they played live for a television broadcast, backing tracks were added underneath and it was mixed as close as possible to the originals, among other reasons for the purpose of them being better "shazamable".

https://www.youtube.com/watch?v=zH_5j3Wm9qM&t=11m38s

Re:Apple has completed its acquisition of Shazam by twtw on Tuesday September 25, 2018 @12:03PM (#18067545)
> digitized metadata

What are you referring to here?

It doesn't recognize you singing because it doesn't have the same spectral content as the full song. Shaman doesn't really identify tunes, it identifies recordings. (And it is amazing to me that it works at all)

Re:Apple has completed its acquisition of Shazam by FPGAhacker on Tuesday September 25, 2018 @11:19AM (#18067015)
To the best of my knowledge, Shazam works on frequency spectrum analysis and how it changes over time. This includes all aspects of the music and not just melody.
Re:Apple has completed its acquisition of Shazam by alfredmuffin on Tuesday September 25, 2018 @11:17AM (#18066998)
Sounds like the problem was your singing.
Re:Apple has completed its acquisition of Shazam by pvinis on Tuesday September 25, 2018 @11:59AM (#18067507)
Pun intended?
Re:Apple has completed its acquisition of Shazam by rlpb on Wednesday September 26, 2018 @09:19AM (#18075596)
It recognises _recordings_, not performances.
Re:Apple has completed its acquisition of Shazam by chrisweekly on Tuesday September 25, 2018 @11:29AM (#18067164)
Try SoundHound for singing
Re:Apple has completed its acquisition of Shazam by avip on Tuesday September 25, 2018 @12:41PM (#18067925)
I have. It outperforms Shazam hands down for this use case. But still very limited.