Skip to content

Suppress Voice Messages While Alarm is Playing #130

@SomdattaNag

Description

@SomdattaNag

Currently, voice messages (speak_event) can play while alarm sounds are active, which may cause overlapping audio or confusion. We need a mechanism to suppress all voice messages while an alarm is playing, but the system should continue running without blocking threads or affecting other functions.

Proposed Feature:

  • Introduce a flag (e.g., alarm_playing) to track when an alarm is being played.
  • Modify all speak_event calls to check this flag before speaking:
  • If alarm_playing = True, skip the message.
  • If alarm_playing = False, allow the message as usual.
  • Ensure that alarms (threat_alarm / safe_alarm) are still played asynchronously and set/reset the alarm_playing flag automatically.
  • Optional: Wrap this logic in a helper method (e.g., safe_speak(event, text, sync=False)) to avoid repetitive checks throughout the code.

Benefits:

  • Prevents overlapping audio between alarms and voice prompts.
  • Maintains non-blocking behavior; system continues functioning normally.
  • Centralizes audio control for easier future enhancements.

Metadata

Metadata

Labels

gssoc25This issue and task is a part of GirlScript Summer of Code 25.level 2Medium level task

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions