Audio Recording Preparer
Overview
Turns a written document into a script that sounds right when read aloud, gets the user's approval for every judgement call, then narrates it with ElevenLabs into one MP3: an announcer voice opens and closes, a narrator voice reads the document.
Core principle: write for the ear, and let the user decide anything you had to guess. A listener cannot glance back at a table, see an image, or click a link. Every one of those is converted, summarised or dropped, and the user approves it before any money is spent on synthesis.
Paths. Below, <skill> means this skill's base directory (the folder holding this
SKILL.md), and <out> means the absolute path of the output folder next to the
source document. Always run python -P <skill>/scripts/<name>.py with absolute
paths, because the working directory is usually the user's project, not this skill.
Python 3.11+. If an import fails, run
python -m pip install -r <skill>/requirements.txt.
Files produced
By default everything goes in a folder <stem>-audio/ next to the source document
(ask before writing anywhere else, and never into this skill's own folder):
| File | What it is |
|---|---|
<stem>.review.md | Every decision you proposed, for the user to approve in one pass |
<stem>.pronunciations.yaml | The pronunciation guide (reusable across documents) |
<stem>.narration.md | The script: what will be spoken, in original spelling. Format: references/script-format.md |
<stem>.mp3 | The recording |
<stem>.mp3.yaml | Everything used to make the MP3 (voices, model, pauses, guide, script snapshot). Regenerates it |
.narration-cache/ | Audio per chunk, so later edits only pay for changed sections |
Workflow
1. Extract
python -P <skill>/scripts/extract.py SOURCE <out>/extract
Read <out>/extract/content.md and <out>/extract/inventory.json. Then look at every file in
extract/images/ and, for PDFs, every page render in extract/pages/. Text
extraction misses charts drawn as vectors, text inside images, and reading order in
multi-column layouts. Fix the order from the renders. If the extractor warns that
pages have almost no text, they are probably scanned: read them from the renders.
For .pptx, .doc or .ppt that can't be read here, the extractor says so. Ask
the user for a PDF export.
The inventory gives you mechanical flags only: typeable_guess on links and QR
codes, pronunciation_candidates, symbols_found, table sizes, image repeats and
dropped_running_text (headers and footers already removed; check nothing real
was dropped).
struck_through: struck-through passages are marked[[STRUCK …]]incontent.md. They are usually deleted wording, but in forms and legal text, always ask the user. The dry run refuses scripts that still contain them.pseudo_headings: bold paragraphs that were promoted to##headings because the author didn't use heading styles. Set their real levels.title_candidates: the document's metadata title is often left over from a template or another language. Prefer the title the document itself shows.
2. Draft every decision
Read references/adapting-for-audio.md and apply it. It covers pronunciation,
headings and pauses, tables, images, links and QR codes, numbers and symbols,
footnotes and citations, things to drop, and French.
Write <stem>.review.md using references/review-template.md, and write
<stem>.pronunciations.yaml with every entry status: proposed. narrate.py
refuses to run while any entry is still proposed. That is how user confirmation is
enforced, so never mark an entry approved yourself.
3. Ask the user, in one round
- Point them at
<stem>.review.mdand summarise it in chat: how many pronunciations, tables, images and links, and what you propose for each group. - Use
AskUserQuestion(at most 4 questions) only for the genuinely uncertain items, usually images you can't classify as meaningful or decorative, and tables where either a summary or "see the table" is reasonable. - Always ask whether this recording needs anything extra in the announcer's
opening or closing (author, date, organisation, "the written version is at…",
copyright). Show the exact lines you propose (defaults: "Announcer lines" in
references/adapting-for-audio.md) so they can be edited. - Confirm the language and the title the announcer will say.
When the user approves (with or without changes), update review.md to match, set
approved entries to status: approved, delete rejected ones, and write the script.
If you cannot ask (you are a subagent or running non-interactively), stop after step 2 and report the open questions. Do not proceed to synthesis.
4. Write the script, then dry-run
Write <stem>.narration.md (format: references/script-format.md). Then:
python -P <skill>/scripts/narrate.py <out>/<stem>.narration.md --dry-run
Fix every listed PROBLEM. It flags leftover tables, markdown links, raw URLs, extraction markers, unapproved pronunciations and missing voices. Read the printed "text that would be sent" and check that the respellings landed where intended. Proposed entries are applied in the preview so you can check them before approval, but generation refuses them.
5. Get approval for the paid call, then synthesise
Tell the user the character count from the dry run (on eleven_multilingual_v2,
roughly one credit per character) and ask before running:
python -P <skill>/scripts/narrate.py <out>/<stem>.narration.md
Needs ffmpeg and <skill>/.secrets/elevenlabs.yaml (copy
<skill>/elevenlabs.example.yaml). Report the MP3 path, its duration, and the sidecar.
Suggest the user listen for any mispronunciations, which become new guide entries.
Regenerating after edits
The user edits <stem>.narration.md (or the pronunciation guide), then:
python -P <skill>/scripts/narrate.py <out>/<stem>.mp3.yaml --dry-run
python -P <skill>/scripts/narrate.py <out>/<stem>.mp3.yaml
Regenerating from the .mp3.yaml reuses the recorded voices and model, so the new
version matches the old. Add --current-config to pick up changed voices instead.
Only chunks whose text changed are synthesised again. The dry run shows how many
characters will be paid for. If the source document itself changed, start again
from step 1, but reuse the existing pronunciation guide.
Quick reference
| In the document | Default in the script | Ask the user? |
|---|---|---|
| Word likely mispronounced | Guide entry with a respelling | Always (via guide) |
| Heading | Spoken, with silence before and a short pause after | No |
| Small simple table (≤ about 4 rows × 3 columns) | Read as sentences | No |
| Large or numeric table | Short summary of what it shows, or "Table 2, …, is in the written document" | Yes, which one |
| Meaningful image, chart, diagram | Concise description | Approve in review |
| Decorative image (logo, divider, stock photo) | Omitted | Approve in review |
| Image you're unsure about | Listed as a question | Yes |
| Short, typeable URL or QR target | Spoken form ("example dot org") | Approve in review |
| Long, coded or tracking URL or QR target | Drop the URL, keep the meaning | Approve in review |
| Running headers, page numbers, TOC | Dropped | No (listed in review) |
Common mistakes
- Describing an image you only saw as
[[IMAGE i3]]. Open the file first. - Inventing facts in a table summary. A summary states only what the table shows. Say "the highest", "rose every quarter", not reasons or trends the document doesn't give.
- Reading a URL letter by letter when it is not typeable. Drop it and say where the link is ("the survey link is in the written version").
- Marking pronunciations approved yourself. Only the user approves.
- Running synthesis without the dry run and an explicit go-ahead. It costs money.
- Leaving the reading order from extraction. Multi-column PDFs interleave columns. Check against the page renders.
- Respelling in the script itself. Respellings go in the guide. The script keeps real spelling so it doubles as a transcript.