-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpm
throws Error 4: Undefined variable bpm
#3527
Comments
bpm
throws Error 4: Undefined variable bpm
Hey @Mikulskii looks like try like this musicSource = mksafe(playlist(id="musicSource", "/mnt/test/bpm"))
musicSourceBpm = bpm(id="bpm", musicSource)
def detectBpm()
metadata = musicSource.last_metadata() ?? []
title = "#{metadata['artist']} - #{metadata['title']}"
bpm = musicSourceBpm.bpm()
bpmWithTitle = "BPM: #{string_of(int_of_float(bpm))} #{title}"
print(bpmWithTitle)
end
def startDetectBpm()
thread.run(delay=5.0, (fun() -> begin detectBpm() {} end))
end
def onMetadataHandler(metadata)
startDetectBpm()
end
musicSource.on_metadata(onMetadataHandler) And look whats happened on track change, maybe for you also always return 0 |
Hey @rrolla !
|
Hi @Mikulskii, |
Hi @vitoyucepi! Ah, that's the thing. |
Took an example from The Liquidsoap Book, but it doesn't work:
Output:
lufs
andrms
are working properly. Tried on versions2.1.2
and2.2.2
- Windows & Ubuntu(via opam)The text was updated successfully, but these errors were encountered: