I dug into the CircuitPython code a bit yesterday and came up with a pull request for the audiomp3 code. This adds a decoded_samples property that can be used to understand how much of the MP3 file has been played. After plugging that into the word clock code, using it instead of the elapsed monoclock time, sync was perfect for the whole song. I could even run the double scaled word clock, which looks great on the PyBadge's small screen. There's a little glitchiness during the more complex part of the song, but it's minor and doesn't make it all go sideways. I also took this opportunity to re-enable the VU meter during the wordless parts of the song, which makes it more visually interesting.
This morning, the PR was accepted, so I think this may be in the next 7.2.0 alpha 2 CircuitPython release. I'm going ahead and updating my project ZIP file with the new source.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.