Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling from python with chunks of sets #11

Open
LeanderK opened this issue Nov 27, 2020 · 3 comments
Open

calling from python with chunks of sets #11

LeanderK opened this issue Nov 27, 2020 · 3 comments

Comments

@LeanderK
Copy link

LeanderK commented Nov 27, 2020

Great Project!

I want to use this to get the ids of track from sets. So let's say I have the audio file of a set, how would I approach it? I would like to have something like a sliding window over the set and use songrec on each window so that I get the time-stamps where the songs change.

I would write a small python scripts which calls SongRec (I don't know any rust).

Does this code just take the raw 12s PCM signals of the middle of the song and return it? Does the algorithm always expect 12s of pcm-data?

pub fn make_signature_from_file(file_path: &str) -> Result<DecodedSignature, Box<dyn Error>> {

@marin-m
Copy link
Owner

marin-m commented Nov 28, 2020

Hello,

I took the approach of extracting 12-second samples out of the middle of files/out of the recent microphone input because it seemed to be a value that provided very good results compared to shorter window sizes, without taking too much processing time.

The core algorithm may look for for frequency peaks over any amount of spectrogram, but if you put more audio into it obviously it will take longer (it performs sliding Fourier transforms over fixed intervals).

Regards,

@LeanderK
Copy link
Author

ok, then I think I will just experimentally decide how long the samples should be and how fast I should slide the window over. I just noticed I wasn't clear, I was talking about DJ-Sets. So I have 2/3 hours long of music and I want to find every song in the set. I'll just try, thanks!

@sebbean
Copy link

sebbean commented Mar 12, 2024

ok, then I think I will just experimentally decide how long the samples should be and how fast I should slide the window over. I just noticed I wasn't clear, I was talking about DJ-Sets. So I have 2/3 hours long of music and I want to find every song in the set. I'll just try, thanks!

Would love to know if you've accomplished this!

Doing the same myself

youtube.com/@beanradio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants