Builds the browser-reader bundle consumed by the React reader.
Source: screencastgen/reader_assets.py
build_reader_assets() converts aligned chunks into the hosted assets consumed
by the React reader. The Offline Reader packages these same
assets into the self-contained downloadable ZIP.
| File | Purpose |
|---|---|
reader_manifest.json |
Metadata, global word timings, chunk text, page mapping, and optional presenter filename |
reader_audio.mp3 |
Concatenated chunk audio used by highlight-only reader output |
presenter.mp4 |
Optional lip-sync presenter video built by Lipsync Pipeline |
pages/page-0001.jpg |
Optional rendered PDF page images for the active-page side panel |
All word timings in the manifest are global timestamps relative to the concatenated audio/presenter timeline.
build_reader_assets(aligned_chunks, output_dir, pdf_path, title, language, presenter) -> str | Nonereader_audio.mp3.reader_manifest.json.None if no chunks were available.reader_asset_names(page_files=None, presenter=False) -> list[str]Returns relative paths for manifest/audio/presenter/page files so storage upload helpers can mirror the full bundle.
{
"version": 1,
"title": "Book title",
"language": "en-US",
"source_type": "pdf",
"duration": 123.456,
"audio": "reader_audio.mp3",
"presenter": "presenter.mp4",
"pages": {
"dir": "pages",
"image_width": 1400,
"files": {"1": "page-0001.jpg"}
},
"chunks": [
{
"chunk_num": 1,
"text": "...",
"offset": 0.0,
"pages": [1],
"words": [{"word": "Hello", "start": 0.12, "end": 0.4}]
}
]
}
Reader Assets
├── Types (AlignedChunk)
├── Extractor (render_page_image_with_zoom for PDFs)
└── pydub / ffprobe (duration and MP3 concatenation)
presenter.mp4