For me the basic idea of Shazam algorithm is very very easy to code, I did it in less than 250 lines in python 10 years ago, and its realy works great ...
You can test the idea starting with the basic:
First you will need generate fingerprint to all songs that you need,
to do it you need build an Spectogram for each chunk audio (you maybe
will test overlap in the future), the key here is split your
spectogram in some ranges band, to keep it easy and basic try split
your bins in 4
bands (course this is a basic example), ex. I choose from bin 50-200
, 200-400
, 400-700
, 700-2048
, if its is the best split ??
probably not lol (one big problem here, all songs sample rates
need be the same obivious), if all song are sampled in 44100hz
and you use FFT size 4096
the first spectrum band bin will cover:
44100*50/4096 = 538.33hz
44100*200/4096 = 2.153hz
wowww its is a big range frequency lol, but is just test to you
understand, now for this chunk audio/spectrum you will need get the
high bin/frequency from this band and store, do the same with the
next 3 bins/frequency bands, at end you can say that you have
generate an fingerprint for this chunk/segment ... for example you
can have a peak for each band and generate you fingerprint as
33-301-450-1031 (333014501031)
, you will do it for the whole audio,
chunk by chunk, at end you will have a lot of fingerprint, store all
for this song... Ahaaa this is my 10 years ago test that
generate fingerprints from David Guetta Feat. Rihanna - Who's That Chick
, Shazam call this all fingerprints of Constelation Map
Now I think you will want to test the algorithm by submitting some unknown audio to see if it works and finds in your base, the process here is the same (remember this unknow song need be sampled at same sample rate from the songs that you build your fingerprint database), but now for each chunk fingerprint you will compare if exist in you database, for example if in this chunk unkow song you get this fingerprint 33-301-450-1031 (333014501031)
and if the same exist in you database I can say that you have one(1) match fingerprint for this song, and if your match continues increase in a linear time this is the same song :-) ...
I test it using 5 seconds samples to try match audios and works like a charm lol, surely you can use the same principle to find repeated points !