Stop analysis while the collector is disabled - #37
Merged
Merged
Conversation
Collector.setEnabled(False) only stopped buffering; the analysis loop gated on `initialized`, which stayed true because neither the buffered audio flag nor the native collector handle changed on disable. The analyzer kept running inference on the frozen buffer every interval, emitting analysis results with incrementing sequence numbers and recording metrics for audio that was no longer being collected. Gate `initialized` on the enabled flag in both runtimes. Re-enabling already resets the analyzer and drops the stale buffer, matching how Processor and VAD handle their own enable toggles, so analysis resumes only once fresh audio arrives. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
steckes
reviewed
Sep 14, 2026
steckes
reviewed
Sep 14, 2026
steckes
left a comment
There was a problem hiding this comment.
Looks good in general, just a nit on the comment that you can make a call on.
Co-authored-by: Matthias Geier <Matthias.Geier@gmail.com>
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.
In both Python and Node plugins, the analysis loop checked for "initialized", which ignored the
setEnabled()flag.This PR adds a check for "enabled".