Audio version — Estimated duration: 2 min 32 sec
Batch-process an entire directory of markdown files.
python tts_pipeline.py --dir ./path/to/docsHow it works
- Scan — Recursively walks the directory, skipping hidden dirs and
voice-notes/ - Order —
index.mdfirst, thenpipeline/, then everything else alphabetically - LLM rewrite — Sends each file to Cerebras or llama.cpp for conversational rewrite
- TTS synthesis — Generates audio via edge-tts or Piper
- Embed — Injects
<audio>tag with duration into the source.mdfile - Save — Writes voice-friendly markdown to
voice-notes/(mirrored tree)
File ordering
| Priority | Folder | Notes |
|---|---|---|
| 1 | . (root) | index.md is always first |
| 2 | pipeline/ | Logical tutorial flow |
| 3 | Everything else | Alphabetical |
The index file gets a special prompt: ~200 words and a suggestion to continue reading the next file.
Rate limiting
Online LLM mode enforces 5 requests per 60 seconds (sliding window). The pipeline pauses automatically — you will see [RATE] messages.
Arguments
See CLI Reference for all flags.
python tts_pipeline.py --dir ./docs --llm local --tts online --voice en-GB-SoniaNeural