From 4cc88a9f81031a40e263594ba95674fed1d3aa80 Mon Sep 17 00:00:00 2001 From: itsrubberduck Date: Wed, 29 Jul 2026 08:41:31 +0200 Subject: [PATCH] docs(plans): add design for classroom local speech bridge support --- ...026-07-29-classroom-local-bridge-design.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/plans/2026-07-29-classroom-local-bridge-design.md diff --git a/docs/plans/2026-07-29-classroom-local-bridge-design.md b/docs/plans/2026-07-29-classroom-local-bridge-design.md new file mode 100644 index 0000000..4488cf2 --- /dev/null +++ b/docs/plans/2026-07-29-classroom-local-bridge-design.md @@ -0,0 +1,32 @@ +# Classroom: use the Local Speech Bridge when available + +## Problem + +`classroom.vue` always calls the cloud `/api/atc/say` endpoint for instructor +TTS. `live-atc.vue` already prefers a locally running Speech Bridge +(`app/composables/useLocalSpeechBridge.ts`, which probes `127.0.0.1:8765-8770` +for `GET /health` and falls back to the cloud path on failure/timeout) via +`useRadioSpeech.ts`. Classroom should get the same local-first behavior. + +## Scope + +- Classroom only performs TTS (`/api/atc/say`); it has no PTT/mic input, so + `/api/atc/ptt` is out of scope. +- No UI indicator for bridge status — matches live-atc's silent fallback. + +## Change + +In `app/pages/classroom.vue`: + +1. Import `postWithLocalFallback, useLocalSpeechBridge` from + `~/composables/useLocalSpeechBridge` and call `useLocalSpeechBridge()` once + during setup (same as `useRadioSpeech.ts:86`). +2. In `requestSayAudio()` (`classroom.vue:4323`), replace the direct + `api.post('/api/atc/say', payload)` call with + `postWithLocalFallback(localUrl('/api/atc/say'), payload, () => api.post('/api/atc/say', payload))`, + matching `useRadioSpeech.ts:274-278`. + +No payload/response shape changes are needed — classroom's payload is already +compatible with what the local bridge and cloud endpoint both expect, and +`sayCache`/`pendingSayRequests` caching is unaffected since it is keyed by +content, not transport.