I\'m interested in programming a music visualizer in Python.
The first problem is how to get the information from the music? Like volume, frequency, rpm, etc. And from w
Another tool for this is librosa. It offers Beat tracking to get bpm, in addition to default operations. According to the tutorial, for beat tracking:
import librosa
audio_path = librosa.util.example_audio_file()
# or uncomment the line below and point it at your favorite song:
# audio_path = '/path/to/your/favorite/song.mp3'
y, sr = librosa.load(audio_path)
y_percussive = librosa.effects.hpss(y)
tempo, beats = librosa.beat.beat_track(y=y_percussive, sr=sr)
As @dionyziz also said, the
beats will be in frames. You can convert them to actual time using
librosa.frames_to_time(beats)
I have not tried this.