Skip to content

Stop analysis while the collector is disabled - #37

Merged
mgeier merged 2 commits into
mainfrom
matthias/stop-analysis
Sep 14, 2026
Merged

mgeier merged 2 commits into
mainfrom
matthias/stop-analysis

Conversation

@mgeier

@mgeier mgeier commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

In both Python and Node plugins, the analysis loop checked for "initialized", which ignored the setEnabled() flag.

This PR adds a check for "enabled".

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>
Comment thread node/src/analyzer.ts Outdated

@steckes steckes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, just a nit on the comment that you can make a call on.

@mgeier
mgeier requested a review from steckes September 14, 2026 14:33
Co-authored-by: Matthias Geier <Matthias.Geier@gmail.com>
@mgeier
mgeier merged commit 19d6abe into main Sep 14, 2026
8 checks passed
@mgeier
mgeier deleted the matthias/stop-analysis branch September 14, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants