Skip to content

Source Audio Plan

Reese Hodge edited this page Nov 8, 2026 · 3 revisions

Source: Audio Plan

Source path: docs/audio-plan.md.

This plan covers generating and integrating static greeting MP3s for Max Height. It is the main source for greeting audio provenance and for the current audio asset posture in Component-Audio-Chain and Contract-Greeting-Manifest.

Core approach

The playback pipeline already existed; the missing piece was the static MP3 asset set. The chosen approach:

  • Generate greetings once with Amazon Polly Neural using hand-tuned SSML.
  • Commit the generated MP3 files as static frontend assets.
  • Measure and write actual durations into the greeting manifest.
  • Keep runtime greeting cost at zero because playback uses committed assets.
  • Defer expensive video generation; avatar images cover the current visual.

Current state recorded by the plan

  • Greeting selector, playback hook, audio chain and volume wiring were already built.
  • Polly TTS was already implemented for conversation audio.
  • The manifest existed with greeting metadata.
  • Sixteen greeting MP3s were generated and committed.
  • The generation script and SSML module were built.
  • File-existence validation for the greeting manifest was still a gap.

Decisions

  • Amazon Polly is the sole generation provider for these assets.
  • SSML is hand-tuned per greeting, but constrained by Polly Neural support.
  • Pitch character comes from playback DSP, not Polly SSML pitch: random glitch-episode jumps since 2026-11-07, not a fixed shift.
  • Duration calibration must measure MP3s and preserve manifest contract bounds.
  • Video is optional/deferred rather than required for MVP greetings.

Credential and budget posture

Generation used temporary AWS session credentials exported into a local shell, not long-lived keys and not local credential files. The plan explicitly ties this to Concept-Credential-Hygiene.

The cost was effectively a one-time static-asset generation cost, not ongoing runtime spend.

Corrections discovered

The plan records a useful testing lesson: silently clamping out-of-range audio durations hid a contract violation. The fix was to throw an aggregated, actionable error instead of coercing data that would clip playback. One greeting was retuned to fit the existing ceiling rather than weakening the contract for all future greetings.

The 2026-11-07 T158 preparation caught another duration hazard: the generator used to overwrite MP3s before rejecting out-of-range measurements, leaving audio mismatched with the old manifest. It now validates all selected durations before writing production recordings. Decision-Polly-Voice owns the trap.

Phonetic audition and faster pacing — production not regenerated

On 003-architecture-review, the existing generator has an isolated --experiment --only <id> mode with three pronunciation candidates. --dry-run previews the requests without AWS calls or writes; a live run writes gitignored clips outside public, leaving the production MP3s and manifest untouched.

The builder requested stronger stutters with unchanged dialogue, then ran the first audition and chose IPA schwa. Its greeting-015 clip measures 16560 ms, over the unchanged 15000 ms ceiling; alias and strut are also overlong. The builder found stutters and speech too slow.

The second audition measured pace-faster at 15408 ms and pace-snappy at 14976 ms. The builder preferred snappy and approved normal speech speed, asking for faster stuttering only.

A third pair (pace-snappier, pace-rapid) and then numeric onset rates (180% and 200%) showed that the <break> gaps, not the onset rate, set stutter speed. The builder chose pace-rapid (greeting-015: 12288 ms), and a 5 ms-gap trial was not better. rapid is now the default pacing and all 16 production MP3s were regenerated, with manifest durations at 8424–14736 ms. The plan records every file duration, whole-dialogue WPM, raw peak/RMS and reconstructed DSP peak/RMS, with measurement limitations. None is a claim of subjective voice acceptance.

T158 stays open for in-app listening through the playback chain and the greeting-005 and non-b checks. Its commands and listening checklist are in the source plan's T158 section. Playback glitching was added after the regeneration; see § Voice glitch episodes below. See Decision-Polly-Voice, Component-Audio-Chain and Contract-Greeting-Manifest.

Voice glitch episodes — built 2026-11-07

The plan's § Voice glitch episodes records the builder's listening choice (Take K): random pitch jumps, syllable replays with a static tick, and tape wobble, in 6–10 s spells separated by 10–20 s of clean voice. The 1.05 pitch worklet was removed, so the base voice is unshifted Polly. It also records that production builds cannot load the worklets. Component-Audio-Chain owns the numbers and design.

Remaining follow-up

The next audio work listed by the plan:

  • Tune mouth threshold against real Polly audio.
  • Add/refine post-audio timing buffer so final words are not clipped.
  • Verify greeting volume behavior.
  • Run Guide-Validation-Gate after code changes.

Agent takeaway

For audio behavior, treat this as source history plus rationale. For the actual implementation, verify current code and assets before assuming plan status is still true.

Clone this wiki locally