Skip to content

Prevent ASR while impedance mode is active#427

Merged
salman2135 merged 2 commits into
developfrom
handle-imp-mode-exception-asr
May 11, 2026
Merged

Prevent ASR while impedance mode is active#427
salman2135 merged 2 commits into
developfrom
handle-imp-mode-exception-asr

Conversation

@salman2135

Copy link
Copy Markdown
Member

Add ImpedanceModeActiveError and guard ASR availability when impedance is running. StreamProcessor gains is_asr_processor_available() which raises ImpedanceModeActiveError if impedance mode is active and otherwise checks the ASR processor initialization. Explore.is_asr_processor_available() now delegates to the stream processor. Also add the new exception import.

Add ImpedanceModeActiveError and guard ASR availability when impedance is running. StreamProcessor gains is_asr_processor_available() which raises ImpedanceModeActiveError if impedance mode is active and otherwise checks the ASR processor initialization. Explore.is_asr_processor_available() now delegates to the stream processor. Also add the new exception import.
@SonjaSt

SonjaSt commented May 11, 2026

Copy link
Copy Markdown
Contributor

Why not just return "False"? Otherwise I would rename the method, as I wouldn't expect a method called "is_available" to throw an exception if the resource isn't available. I think a "start_cleaning" method could throw this exception, but not "is_available".

@SonjaSt SonjaSt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@salman2135

Copy link
Copy Markdown
Member Author

Why not just return "False"? Otherwise I would rename the method, as I wouldn't expect a method called "is_available" to throw an exception if the resource isn't available. I think a "start_cleaning" method could throw this exception, but not "is_available".

Fair enough, the name could be improved. I am inclined to keep the exception as it is and rename the method as this will help to understand fail cases.

@salman2135 salman2135 merged commit 01783a7 into develop May 11, 2026
1 of 3 checks passed
@salman2135 salman2135 deleted the handle-imp-mode-exception-asr branch May 15, 2026 15:34
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