From 33b9c9e099a4d1248ab635b597447030d4192a82 Mon Sep 17 00:00:00 2001 From: Chigozirim Igweamaka Date: Sun, 23 Jun 2024 14:19:02 +0100 Subject: [PATCH] Update comment --- shazam/fingerprint.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/shazam/fingerprint.go b/shazam/fingerprint.go index 01cd700..046cffd 100644 --- a/shazam/fingerprint.go +++ b/shazam/fingerprint.go @@ -12,10 +12,8 @@ const ( // Fingerprint generates fingerprints from a list of peaks and stores them in an array. // The fingerprints are encoded using a 32-bit integer format and stored in an array. -// Each fingerprint consists of an address and a table value. -// The address is calculated based on the frequency of the anchor and target points, -// as well as the delta time between them. -// The table value contains the anchor time and the song ID. +// Each fingerprint consists of an address and a couple. +// The address is a hash. The couple contains the anchor time and the song ID. func Fingerprint(peaks []Peak, songID uint32) map[uint32]models.Couple { fingerprints := map[uint32]models.Couple{} @@ -24,8 +22,8 @@ func Fingerprint(peaks []Peak, songID uint32) map[uint32]models.Couple { target := peaks[j] address := createAddress(anchor, target) - anchorTimeMs := uint32(anchor.Time * 1000) + fingerprints[address] = models.Couple{anchorTimeMs, songID} } }