Home > Mobile >  How to get music BPM value (beat of the music)
How to get music BPM value (beat of the music)

Time:10-12

Recently the company has a project, to get the value of BPM, music people know

CodePudding user response:

This thing I want to half a year ago,,, and the android source code, or implementation approach, detail, finish to set up checked posts in this place now

CodePudding user response:

The building Lord if found please inform

CodePudding user response:

Simple in python:
The import librosa
The import numpy as np
Yy, sr=librosa. Load (' xx. Mp3 ')
Onset_env=librosa. Onset. Onset_strength (y, sr=sr, hop_length=512, aggregate=np. The median)
Tempo, _=librosa. Beat. Beat_track (onset_envelope=onset_env, sr=sr)
BPM tempo is what you want

CodePudding user response:

Atitit read audio music file BPM

Directory
1.1. Librosa is an audio frequency, the music analysis, processing of python toolkit, 1
1.2. \ BPM. Py 1
1.3. The Echo 2
1.4. Code desc
21.5 ref 4


1.1. Librosa is an audio frequency, the music analysis, processing of python toolkit,
Some of the common time-frequency processing, feature extraction, drawing graphics functions such as sound, function is very powerful, this paper mainly introduces librosa installation and usage,
Librosa a total of about 50 m

1.2. \ BPM py
# thie file encode is utf8
# DJDDD C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python37 \ Python exe D: \ 00 WKSPC \ BPM py
The import librosa
The import numpy as np

Yy, sr=librosa. Load (' D: \ \ 00000 \ \ just like _ _ just like sun language. Mp3 ')
Onset_env=librosa. Onset. Onset_strength (yy, sr=sr, hop_length=512, aggregate=np. The median)
Tempo, _=librosa. Beat. Beat_track (onset_envelope=onset_env, sr=sr)
Print (tempo)
# tempo is ye BPM
# sr is samp rate instead

1.3. The Echo

C:\Users\Administrator> C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python37 \ Python exe D: \ 00 WKSPC \ BPM py
112.34714673913044

1.4. Code desc

The import librosa
The import numpy as np
Yy, sr=librosa. Load (' xx. Mp3 ')
Onset_env=librosa. Onset. Onset_strength (y, sr=sr, hop_length=512, aggregate=np. The median)
Tempo, _=librosa. Beat. Beat_track (onset_envelope=onset_env, sr=sr)
Tempo is ye BPM



> # to Load a wav file
> Y, sr=librosa. Load ('./beat. Wav ')
> Y
E+00 array ([0.00000000, 0.00000000 e+00, 0.00000000 e+00,...,
8.12290182 e-06 e-05 1.34394732, 0.00000000 e+00], dtype=float32)
> The sr
22050
Librosa sampling rate is 22050 by default, if you need to read the original sampling rate, need to set parameters of sr=None:
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Visible, 'beat. Wav' original sampling rate is 44100, if you need to re-sampling, just need to set the sample rate parameter sr as you need to value:



1.5 ref
(9 + message) audio processing library to install and use - z small white - librosa blog - CSDN. HTML
  • Related