Files
logic-puzzle/scripts/render_drama_previews.py
T
Hadrian Burkhardt 0718e3f252 Open Lumen on a responsive bookshelf and land pending story work
- Start the app on a shelf of every installed book instead of the last
  book's home. Cards show the cover, translated metadata, available
  languages, restored patterns and either "Continue reading" or a way in.
- Keep each book's saved route: the shelf is never written to
  flutter_screen, so choosing a book resumes its own leaf.
- Lay the shelf out responsively: dense single-column cards on phones,
  a two-column grid from 720 logical pixels, a centred 860 px column on
  tablets and a chevron that exists in the bundled handwriting font.
- Keep Settings reachable from the shelf and let the home page's story
  library button open the shelf instead of a dialog.
- Add tool/shelf_screenshots_test.dart, which renders the shelf at phone
  and tablet metrics, checks that every card and Settings stay reachable
  without overflow, and writes artifacts/library/shelf-*.png.
- Commit the pending Midnight Invitation package (campaign, notebook,
  narration and artwork), cast drama and ambience tooling, region
  selection, phone/tablet integration coverage and related docs.

flutter analyze is clean and all 74 widget/domain tests pass.
2026-11-05 14:29:50 +01:00

24 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""Export the pilot readings plus their quiet atmosphere for listening outside Lumen."""
import json
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
PACKAGE = ROOT / 'assets/stories/midnight-invitation'
OUT = ROOT / 'artifacts/audio-pilot'
OUT.mkdir(parents=True, exist_ok=True)
tracks = json.loads((PACKAGE/'audio/narration_manifest.json').read_text())['tracks']
for page, scene, name in [
('midnight.feather.memory', 'threshold', '01-at-the-door'),
('midnight.candle.entry', 'kitchen', '02-in-the-kitchen'),
]:
track = tracks[page]
# Same speech-time atmosphere gain as the app's default .7 volume setting.
duration = track['durationMs'] / 1000
subprocess.run(['ffmpeg','-v','error','-y','-i',str(ROOT/track['asset']),
'-stream_loop','-1','-i',str(PACKAGE/f'audio/ambience_{scene}.wav'),
'-filter_complex',f'[1:a]volume=0.07,afade=t=in:d=0.5,afade=t=out:st={duration-.8}:d=0.8[bed];[0:a][bed]amix=inputs=2:duration=first:normalize=0[out]',
'-map','[out]','-c:a','pcm_s16le',str(OUT/f'{name}.wav')],check=True)
print(OUT/f'{name}.wav')