Repository navigation
Decision Browser TTS Fallback
Amazon Polly Neural is the primary TTS path, but the project has a hard
$10/month budget ceiling and graceful degradation requirements. Before this
decision, reaching the $8 soft-degrade threshold meant voice could disappear
entirely. research.md R9 changes that into degraded voice instead of silence.
This page covers only the fallback. The primary voice decision lives on Decision-Polly-Voice.
research.md R9 proposed the behavior below and browser-speech fallback code
exists, but constitution P1 explicitly requires all TTS on AWS. The
source's claim that an additive fallback needs no amendment does not override
P1. This is not an approved exception: the forthcoming re-architecture
spec must either seek a constitutional amendment or revise the fallback.
No choice is made by this wiki reconciliation.
The proposed fallback uses the browser's native SpeechSynthesis API as
zero-cost degraded voice when the budget soft-degrade path disables Polly.
Concrete source values:
| Item | Source value |
|---|---|
| Browser API | SpeechSynthesis |
| Activation threshold | $8 budget soft-degrade event |
| Polly cost during fallback | $0, because Polly is disabled |
| Browser TTS cost | $0 |
| Fallback pitch | 1.2 |
| Fallback rate | 1.05 |
| Preferred locale | en-US |
| Preferred voice names | containing Google or Microsoft
|
| Last fallback | default browser voice, then text-only if unavailable |
The trigger is a session_state_change event handled by budget degradation
logic. On the first fallback utterance, Max should frame the quality shift
in-character as signal degradation.
The user still hears Max when Polly is budget-capped, which better matches Concept-Graceful-Degradation than dropping directly to text-only.
The quality is intentionally worse and less consistent:
| Limitation | Impact |
|---|---|
| Voice varies by OS/browser | Character voice is not guaranteed. |
| No raw audio buffer access | The AudioWorklet stutter, pitch, static, and EQ chain cannot be applied. |
| No SSML | Polly prosody cannot be reproduced exactly. |
| No viseme data | Lip-sync preparation is unavailable. |
| Platform quality varies | Some voices sound robotic. |
Although the browser only speaks already-produced text rather than running a local LLM, P1 explicitly covers TTS as well as LLM inference. Not running an LLM does not make browser speech constitutionally compliant.
| Alternative | Rejected because |
|---|---|
| Text-only at $8 | Simpler, but a worse degradation path when free voice is available. |
| Pre-generated budget-mode audio | Cannot cover dynamic LLM responses. |
| Third-party free TTS | Adds dependency and uncertain long-term cost/quality. |
Proposal verified against research.md R9 and plan.md on 2026-09-26;
conflict checked against constitution P1 on 2026-09-30. Do not compare
SpeechSynthesis.pitch = 1.2 directly to the Polly AudioWorklet pitchFactor;
research.md says they are different units. See Component-Audio-Chain and
Contract-Polly-TTS for implementation-facing details.
- Concept-Cloud-Only-Inference
- Concept-Budget-Ceiling
- Concept-Personality-Gate
- Concept-IP-And-Legal-Posture
- Concept-Supply-Chain-Discipline
- Concept-Graceful-Degradation
- Concept-Observability
- Concept-Testing-And-TDD
- Concept-Credential-Hygiene
Editing in the browser? Wiki edits are live and bypass wiki:lint. Read
Guide-Wiki-Contributing first.