# Briefing (proof of concept)

Animated presenter briefing for action items — issue apiintl/apiconnect#27. An illustrated
presenter in a bright office set reads a script with pre-rendered expressive TTS, lip-synced mouth shapes and captions, and asks
questions whose answers pick the next line. The script format and the responses JSON are
documented for writers in `docs/BriefingFormat.md`.

## Files

Everything is named `briefing*` so it can be moved to its own project:

| Path | What |
| --- | --- |
| `code/briefing/config.php` | Settings: service URLs, paths, lexicon, `public` flag |
| `code/briefing/briefing_script.inc.php` | Script parser (format documented at the top) |
| `code/briefing/briefing_render.inc.php` | TTS → loudnorm → lip sync → captions, clip cache, manifest |
| `scripts/briefingRender.php` | CLI that renders a script |
| `pages/briefing/player.php` | `/briefing` list and `/briefing/<slug>` player (standalone page, not the connect layout) |
| `pages/briefing/media.php` | `/briefing/media/<hash>.wav\|vtt`, with Range support for Safari |
| `web/ui/briefing/` | Player JS/CSS, the layered SVG presenter (`puppet.svg`) and office set (`office.svg`) |
| `data/briefing/scripts/*.briefing` | Script sources (committed) |
| `cache/briefing/` | Rendered clips and manifests (generated, gitignored) |

The only connect-specific pieces are the two routes in `code/route.inc.php` and the optional
`$_SESSION['authed']` check when `public` is false.

## Using it

    php scripts/briefingRender.php demo            # render, then open /briefing/demo
    php scripts/briefingRender.php demo --dry-run  # what still needs rendering

The render services (Chatterbox TTS and Rhubarb on 192.168.64.12) are CPU-only, so expect around
5× real time. Clips are cached by a hash of (engine, model, voice, emotion, exaggeration, seed, TTS
text), so only changed lines re-render. To re-roll a take, change that line's `seed=`.

## Not in the POC yet

No auth, no database (answers aren't stored; the viewer can export them as the responses JSON), voice replies fall back to a typed answer,
no per-recipient rendering (variables are fixed at render time), captions are timed from
Rhubarb's pauses rather than forced alignment, and no progress save or "jump to my part".
