Skip to content

Allow script speech during media playback and prioritize speech hooks - #148

Merged
trypsynth merged 2 commits into
trypsynth:masterfrom
willbilec:codex/script-speech-during-media
Oct 10, 2026
Merged

trypsynth merged 2 commits into
trypsynth:masterfrom
willbilec:codex/script-speech-during-media

Conversation

@willbilec

Copy link
Copy Markdown
Contributor

Script speech can be silently dropped while media is playing. Speech-rewriting hooks can also miss their 30 ms deadline behind queued script callbacks, while a timed-out hook can continue running with a separate 250 ms budget.

This fixes both paths:

  • Add the audio-playback feedback flag to backtalk.speak, allowing queued and interrupting requests during playback while retaining existing speech permissions and mute, recording, recognition, and call policies.
  • Prioritize speech hooks over queued background callbacks and share the existing 30 ms deadline across queue time, snapshots, and all listeners. Discard late rewrites, remove canceled queued requests, and prevent priority hooks from running while app activation or script/permission updates are pending.

The deadline is unchanged, and hooks cannot interrupt a task already running. Update the scripting guide and differences documentation, and add eight regression tests for queue ordering, timeout cleanup, same-thread reentry, and shared deadlines.

Follow-up to #62. The media-playback and timing changes are in separate commits.

Validation:

  • Phone and Wear debug APKs built successfully.
  • All 599 phone unit tests and 345 TalkBack Wear unit tests passed.
  • Both fixes were confirmed working on a Samsung Galaxy S23+ (SM-S916W), using a separate test app installation.
  • git diff --check passed.
  • Full :lintPhoneDebug was run and failed with 153 MissingTranslation errors in strings.xml, strings_gemini_api_key.xml, and strings_scripts.xml. These resource files are unchanged by this PR; no new UI strings or lint-baseline changes are included.

@trypsynth
trypsynth merged commit ef18fc2 into trypsynth:master Oct 10, 2026
2 checks passed
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