Skip to content

Conversation

@dorkdiaries9
Copy link

@dorkdiaries9 dorkdiaries9 commented Oct 28, 2025

Description

This update adds exception handling in the listen_for_command() function to prevent crashes when the speech recognizer fails or the user remains silent. The function now handles common errors and exits gracefully instead of terminating the program.

Changes Made

  • Wrapped audio capture and recognition in a try-except block
  • Handled UnknownValueError, RequestError, and general exceptions
  • Added console logging for debugging

Impact

Improves application stability and user experience by preventing unhandled exceptions during speech recognition.

Type of Change

  • Bug fix

@akoip akoip force-pushed the main branch 3 times, most recently from 08ac4f1 to a851b12 Compare October 29, 2025 06:05
@dorkdiaries9 dorkdiaries9 reopened this Oct 29, 2025
@akoip akoip force-pushed the main branch 7 times, most recently from ca0885c to 353dd37 Compare October 30, 2025 12:25
@dorkdiaries9
Copy link
Author

@akoip — Added exception handling to listen_for_command() to prevent crashes when speech recognition fails. Requesting your review when convenient.

@akoip akoip force-pushed the main branch 12 times, most recently from 6aeff0a to 1ec6482 Compare November 2, 2025 00:37
@akoip akoip force-pushed the main branch 30 times, most recently from 0eb4d70 to 036225e Compare November 8, 2025 10:30
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