Update comment

This commit is contained in:
Chigozirim Igweamaka 2024-06-23 14:19:02 +01:00
parent 2f3bb8d32b
commit 33b9c9e099

View file

@ -12,10 +12,8 @@ const (
// Fingerprint generates fingerprints from a list of peaks and stores them in an array. // 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. // 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. // Each fingerprint consists of an address and a couple.
// The address is calculated based on the frequency of the anchor and target points, // The address is a hash. The couple contains the anchor time and the song ID.
// as well as the delta time between them.
// The table value contains the anchor time and the song ID.
func Fingerprint(peaks []Peak, songID uint32) map[uint32]models.Couple { func Fingerprint(peaks []Peak, songID uint32) map[uint32]models.Couple {
fingerprints := 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] target := peaks[j]
address := createAddress(anchor, target) address := createAddress(anchor, target)
anchorTimeMs := uint32(anchor.Time * 1000) anchorTimeMs := uint32(anchor.Time * 1000)
fingerprints[address] = models.Couple{anchorTimeMs, songID} fingerprints[address] = models.Couple{anchorTimeMs, songID}
} }
} }