feat(short): la paleta de audio viva — GET /audio en el contrato, el prompt y el bucle de edición
Build & Deploy ResearchOwl / build-and-push (push) Successful in 9s

shortsmith ya compone la banda sonora (sonar); ahora publica una paleta
(pulse, static) y este repo la consume en vivo: el prompt la ofrece con sus
notas de mood, validate_spec la usa como fuente de verdad para audio.preset,
y editar el preset en /short_spec es la manera gratis de escucharlas. Sin
/audio (404 o caída) todo cae a la paleta base y nada deja de renderizar.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
ChemaVX
2026-08-06 14:41:27 +00:00
co-authored by Claude Fable 5
parent 1fd0c1b3d6
commit 93a506b636
11 changed files with 259 additions and 34 deletions
+26 -18
View File
@@ -34,26 +34,34 @@ the expected outcome (audio first), but the gate can reorder them.
## Phase 4 — sound
The largest single lever. A silent Short is penalised de facto: retention is the
algorithm's primary signal and silence invites the swipe at second one. Three deliverables,
shipped in this order because each is useful without the next.
> **Corrected after reading the shortsmith source** (the first draft of this section
> assumed silent renders and proposed royalty-free tracks on disk — both wrong).
> shortsmith has synthesized audio by design: numpy only, no samples, no licensing
> exposure, deterministic to the sample, with the spec's `audio: {preset, silence}`
> block and the validated `sonar` composition guarded by a reference gate. The right
> 4a for that architecture is a wider palette of synthesized presets, not files.
### 4a. Music bed + transition SFX
### 4a. The preset palette — **shipped 2026-08-06**
- shortsmith: new **optional** top-level spec block:
- shortsmith: `pulse` (sub-bass heartbeat tightening past the midpoint — tension, for
debunks) and `static` (shortwave noise bed, seeded crackles, faint drone — document
drops) joined `sonar` and `none`. Same arc grammar (nothing starts inside a `silence`
window, closing swell, same limiter chain); `static`'s noise comes from seeded legacy
`RandomState` streams, which NEP 19 froze — deterministic on any numpy. `GET /audio`
publishes the palette with one-line mood notes.
- researchowl: the client fetches the palette (404 → the baseline pair, fallback
convention), `validate_spec` takes it as the live source of truth for
`audio.preset`, and the prompt offers it with the mood notes so the model matches
preset to narrative shape. The edit loop accepts it too: changing `audio.preset` in
the `/short_spec` file and re-sending is the free way to audition the palette.
```json
"audio": { "track": "static_dread", "volume_db": -14 }
```
### Deferred from 4a: shot-boundary transition accents
A small curated set of royalty-free tracks (35, matching the channel's tone) baked
into the shortsmith image as assets. Track names are advertised in the `GET /templates`
response (a new `audio.tracks` key) so the prompt can list them without hardcoding —
same reasoning as the template schemas. ffmpeg mixes at final assembly; a short whoosh
on each shot boundary comes free from the same mix.
- researchowl: **zero code**. The prompt gains one line ("pick a track from: …",
fed from the contract fetch). Old specs without `audio` render silent, as today.
- Determinism holds: same spec, same output.
A synthesized whoosh at each cut. Deliberately not done yet: `audio.py`'s presets are
fixed compositions that know nothing about the shots, and that one-way line is worth
keeping until the palette itself proves its value. If it happens, it is an opt-in
`Audio.transitions` flag with boundaries passed alongside `silence` — additive, and
`sonar`'s reference gate must not notice.
### 4b. Narration (TTS) + burned-in captions
@@ -172,8 +180,8 @@ One change at a time, verified before the next — and phase-gated by the Analyt
from §0.
1. Publish 34 Shorts with the current pipeline. Read the retention curves.
2. Phase 4a (music). Smallest change, immediate feel upgrade, proves the `audio` contract
extension end to end.
2. ~~Phase 4a~~ — done (the preset palette, see above; the user chose to skip the gate
for the mechanism and let the published Shorts test the palette itself).
3. Phase 4b (narration + captions), grounding extension in researchowl **first** — build
the check before the thing it checks, same reasoning as phase 2 §12.
4. Free-work templates whenever convenient; they ride along.