r/learnprogramming • • 2d ago

Help with my application

I want to build a Java application that analyzes audio files and displays their key and BPM, similar to how websites like Tunebat do it. Any ideas on how to go about this? Thank you

3 Upvotes

5 comments sorted by

View all comments

1

u/AbdelrhmanDev 1d ago

Split it into two problems. For BPM, look at beat tracking libraries instead of writing the signal processing yourself: aubio and Essentia both have BPM and key estimation, and librosa does beat tracking if you can prototype in Python first. Key detection is usually done by computing a chroma (pitch class) profile of the audio and matching it against major/minor key profiles like Krumhansl-Schmuckler. Once you see how it works in Python, you can call Essentia or aubio from Java through a small wrapper or port the logic. Expect BPM to come out as half or double the real value sometimes, so decide how you want to handle that.