question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lost the last beat in audio

See original GitHub issue

BEFORE 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. image

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:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dpwecommented, Apr 15, 2021

Did you try passing “trim =False” to beat_track?

DAn.

On Wed, Apr 14, 2021 at 22:43 Laotree @.***> wrote:

BEFORE POSTING A BUG REPORT Please look through existing issues (both open and closed) https://github.com/librosa/librosa/issues?q=is%3Aissue 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 all. 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 https://librosa.org/doc/main/tutorial.html#quickstart

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. [image: image] https://user-images.githubusercontent.com/16837634/114805730-16710580-9dd6-11eb-8d14-1486d5444672.png

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/librosa/librosa/issues/1309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEGZUPXGDWK4AGZICYVFN3TIZHFXANCNFSM426RMYNQ .

0reactions
Laotreecommented, Apr 15, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to find lost Beats headphones and track them - Pocket-lint
If you tap on your lost Beats headphones from the list, you will be able to see their last location, get directions to...
Read more >
Lost Kings - Stuck (Audio) ft. Tove Styrke - YouTube
Lost Kings “Stuck” ft. Tove Styrke Available Now! http://smarturl.it/LKStuck?IQid=ytSTREAM Spotify - http://smarturl.it/LKStuck/spotify?
Read more >
Luke Christopher - Lost (Visual) - YouTube
TMRWFRVR - The Debut Album from Luke Christopher featuring "Waterfalls" Download on Apple Music: http://smarturl.it/iTMRWFRVRStream on ...
Read more >
Leo Stannard - Lost (Embody Remix)[Audio] - YouTube
This is Embody's remix of Leo Stannard ' Lost '. Download: http://po.st/ytLostrmxStream: http://po.st/ytLostrmxspLeo Stannard Free Rein EP, ...
Read more >
Matt Cardle - Lost & Found (Audio) - YouTube
Matt Cardle - Lost & Found ( Audio )The new album 'Time To Be Alive', available now: http://smarturl.it/MC_PI?IQid=yt.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found