Files
logic-puzzle/assets/narration/README.md
T
Hadrian Burkhardt a863b0ca93 Rearrange landscape puzzle layout
Landscape leaves now lay the puzzle out in two columns: the whole grid
keeps one column (square, sized to the page) with the heading, area
totals, hint/undo and notes beside it, and the leaf navigation folds
into a single row. The game leaf also keeps its actions in a compact
bottom bar, so the board and controls are visible without scrolling.

- Leaf gains an optional wideBody used on landscape pages.
- Board gains maxWidth, defaulting to the previous 350.
- Split the puzzle body into area, board and note builders so both
  layouts share the same controls.
- Add a landscape widget regression test and document the layout.

This snapshot also carries the pending 2.0.2 notebook work already in
the tree: read-ahead restore, bundled PCM WAV narration assets, the
audio consistency comment, version 2.0.2+11, and the related unit,
integration and script updates.
2026-10-31 06:21:36 +01:00

2.7 KiB
Raw Blame History

Bundled diary readings

Five fixed readings accompany the opening notebook leaves. They are synthetic narration rendered during development, using Kokoro v1.0 / bf_emma (British female), not human voice-actor recordings. The app only plays files using just_audio’s platform decoder. It contains no speech model, Android reader integration, runtime synthesis, or audio download.

  • scripts.json: canonical non-puzzle text loaded directly by the Flutter story pages.
  • wav/: reviewable 24 kHz mono PCM16 WAV masters.
  • manifest.json: model/voice checksums, generator versions, exact scripts, passage timings and WAV and FLAC checksums.
  • assets/audio/narration_*.wav: bundled PCM16 copies, byte-identical to the WAV masters.
  • assets/audio/narration_*.flac: archival lossless exports, excluded from the APK.
  • licenses/: Kokoro ONNX wrapper MIT and model Apache 2.0 licenses.

The voice uses generation speed 0.82, short fades, paragraph pauses and peak normalization. The in-app speed control changes playback speed without changing pitch. Pausing preserves the actual recording position; leaving a page releases playback. Readings never autoplay on entry.

Regeneration

Generator: kokoro-onnx. Model and voice data: kokoro-v1.0.onnx and voices-v1.0.bin from its model-files-v1.0 release. See the upstream voice guide.

Use Python 3.12, dependencies pinned in requirements.txt and ffmpeg. Keep model data outside the app project. Edit the canonical scripts.json text before regenerating:

python scripts/render_narration.py --model /path/to/kokoro-v1.0.onnx --voices /path/to/voices-v1.0.bin
python3 scripts/check_narration_assets.py

The check requires only Python’s standard library and ffmpeg. It verifies script freshness, cue coverage, master format, checksums and runtime WAV/master equality and bit-identical WAV/FLAC decoding. It also rejects Flutter device-reader imports in app code. Listen to new takes before accepting them; automated checks cannot judge performance or pronunciation.

A future actor recording can replace the masters and bundled assets while preserving stable page IDs. Update passage timings and checksums with that recording; never silently change the written script to fit audio.

Playback uses PCM WAV because the connected Huawei API 26 tablet advanced the FLAC clock without creating an AudioTrack. WAV produces an active, unmuted 24 kHz mono PCM media track through the speaker, and the user confirmed audible speech. The release smoke test now checks that mixer track, in addition to pause/resume and elapsed time.