Repository navigation
split audiotap, add LevelReader - #11937
Merged
Merged
Conversation
dhalbert
approved these changes
Nov 21, 2026
dhalbert
left a comment
Collaborator
There was a problem hiding this comment.
Thanks! This seems good. Can you think of anything else that this might implement that either might be:
- not a level but some other statistic (like FFT or some other frequency-based thing??). If so maybe a more general name.
- anything else that might be expensive and so you'd want to turn it on and off? If so maybe enabling and disabling, which we already discussed.
But maybe an FFT would be a separate audiotap class.
Collaborator
Author
|
I had imagined FFT or other use cases getting new classes created. Another alternative approach for general use cases would be if have a good API to hand this data off to C or viper modules compiled to .mpy. Then users could create custom handling for whatever case they need without additional core code. But if there are very commonly used ones it might be good to move them in to the core in new classes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on recent discussion from discord. Split the
audiotap.Tapclass so that users who wantreadinto()don't have to spend CPU on calculatingpeakandrms.A new
LevelReaderclass accepts a Tap in its constructor to attach to. It calculatespeakandrmsvalues from audio in the Taps stream.This is a breaking change for any code that was using
Tap.peakorTap.rms.