Simple BPM detection for live audio coming from outside Unity?

Somehow, all the threads about this topic are incredibly old and don’t offer much in terms of an easy solution, so I’m going to make this new one and hope that someone has a more modern answer to an old problem.

I’d like to, very simply, detect the BPM of audio that is currently playing on my Windows computer, no matter where the source is from. I am not trying to find BPMs for Unity AudioClips or Unity AudioSource or anything playing inside Unity! The CSCore Plugin gets pretty close, having a demo that displays a visualizer representing any audio playing on the computer. The troublesome part is knowing the algorithm necessary to read and process the audio spectrum in such a way that Unity can estimate and output the BPM. The best answers I’ve found are “it’s difficult math, here’s a bunch of code in a YouTube video, no you can’t have the source” with very little explanation behind the code, which I would very much like to have!

Keep in mind I’m not expecting the program to instantly know the BPM of an audio source, it ought to take a few seconds to really understand it (this is how Traktor works, after all) and also like Traktor, it should be a value that is updated constantly, not taken once and used forever. I also know certain tracks are better or worse for accurate BPM, this is fine. I’m making something rudimentary for me, not for a professional product.

The fact that nobody’s really discussing this in a way that Google can find makes me think there’s already some solution out there everyone is using… or nobody is finding it necessary to get a BPM of live audio in their Unity project. So what does this forum think?

Interestingly, I came across this DLL that supposedly did exactly what I needed over at BPM Detection Library (taken from this very forum) but unfortunately, the download link is now dead. However, the documentation should be more than enough proof that what I’m asking for shouldn’t be impossible, let alone rare or as difficult to find as I’m currently experiencing!

The closest I’ve come to coming up with my own algorithm is averaging spectrum data each frame on a FixedUpdate of 60fps (easy to maintain when there’s no rendering going on) and recording each frame the average descends (a certain amount) after it ascended (a certain amount) but the data I’m getting isn’t very accurate. I gotta believe someone else came up with a decent solution to this, right?

This is an open source one that sounds pretty serious:
https://github.com/aubio/aubio