akgupta1337 / Shazzam-Clone

A Python project for audio fingerprinting using the Shazam algorithm. It utilizes libraries like NumPy, PyDub, Matplotlib, and SciPy to extract audio features, generate hashes, and compare audio signatures for song identification.
1 stars 2 forks source link

Why is this done so? why not directly do a Append? copying a array to new opject take a lot of time and inside loop it is n^2 #2

Open yasirysr47 opened 8 months ago

yasirysr47 commented 8 months ago

https://github.com/akgupta1337/Shazzam-Clone/blame/75b18e81d8cfbfc10710b79d5227942ee405dbec/logic/Shazzam.py#L152

yasirysr47 commented 8 months ago

I might be wrong here, Just asking this question so you can give me a solid answer, If I am right, then you get to improve the performance

akgupta1337 commented 8 months ago

the thing is that's just how pandas works, i tried testing it first with simply

sample._append(x)

it didn't appended anything, then i tried

sample = sample._append(x)

then it worked, both sample and x are of type pd.dataframe.

Also there are only 2 channels and assuming recording is short, we can ignore it for a while.