Lost the last beat in audio
See original GitHub issueBEFORE POSTING A BUG REPORT Please look through existing issues (both open and closed) to see if it’s already been reported or fixed! done, but not found
Describe the bug First of all, thanks for this repository, it helps me a lot. Here is where I am trapped: I record a audio of 12 seconds which has 8 beat ‘da’, and the last beat exists after the eighth second. but when I use the example code in quick start
y, sr = librosa.load('path to da')
# 3. Run the default beat tracker
tempo, beat_frames = librosa.beat.beat_track(y=y, sr=sr)
print("Estimated tempo: {:.2f} beats per minute".format(tempo))
# 4. Convert the frame indices of beat events into timestamps
beat_times = librosa.frames_to_time(beat_frames, sr=sr)
I print out the result, it only contains 7 beat ‘da’, the last one was lost
Estimated tempo: 47.85 beats per minute
[0.62693878 1.88081633 3.11147392 4.31891156 5.54956916 6.68734694
7.77868481]
I recorded different count of beats several times,each of them lost the last beat, I use other music audio several times,each of them lost the last beat as well. To Reproduce
Expected behavior point out why the last beat lost, or help me find it out.
Screenshots If applicable, add screenshots to help explain your problem.
Software versions*
Python 3.9.0 (v3.9.0:9cf6752276, Oct 5 2020, 11:29:23)
[Clang 6.0 (clang-600.0.57)]
>>> import numpy; print("NumPy", numpy.__version__)
NumPy 1.20.2
>>> import scipy; print("SciPy", scipy.__version__)
SciPy 1.6.2
>>> import librosa; print("librosa", librosa.__version__)
librosa 0.8.0
Additional context env info: MacOS Big Sur: 11.2.2 audio type: wav
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
Did you try passing “trim =False” to beat_track?
DAn.
On Wed, Apr 14, 2021 at 22:43 Laotree @.***> wrote:
It’s not a graceful solution. If threshold could not be passed,
default threshold which is 0.0 when trim is False, may not distinguish correct beat from noise thanks again