Add spoken exercise instructions (on-device TTS)

Speak exercise setup and form cues aloud with AVSpeechSynthesizer:

- Library detail: a speaker toolbar button reads the full reference aloud.
- Active workout: an opt-in "Speak Exercise Cues" setting speaks a brief
  cue (Setup/Execution/Cues) when an exercise starts, hands-free.
- Settings › Voice: pick the voice (auto-prefers an installed enhanced/
  premium English voice), a premium-download nudge shown only while on a
  basic voice, and a Speed/Pitch/Volume sheet with Reset to Defaults.

On-device and offline; ducks other audio rather than stopping it. iPhone
only for now. Shared SpeechSettings is the single source of truth for the
voice/prosody, read fresh per utterance so changes preview live.

Claude-Session: https://claude.ai/code/session_01BQcEWmAPA78338QuEwRkAh
This commit is contained in:
2026-07-09 13:27:40 -04:00
parent 8c8f22850e
commit 0f5f11e5e2
12 changed files with 615 additions and 8 deletions
+4
View File
@@ -19,6 +19,10 @@ final class AppServices {
let workoutLauncher = WorkoutLauncher()
let workoutHealthDeleter = WorkoutHealthDeleter()
/// Speaks exercise instructions aloud (library Speak button + hands-free workout cues).
/// Shared so a new exercise's cue cancels whatever the last screen was still saying.
let speechAnnouncer = SpeechAnnouncer()
/// Owns the active-workout Live Activity (lock screen + Dynamic Island). Driven by the run
/// flow's `LiveProgress` frames, so locking the phone mid-set doesn't lose the timer.
let liveActivity = WorkoutLiveActivityController()