Expand Lumen stories and add island postcards

This commit is contained in:
Hadrian Burkhardt
2026-11-13 10:18:42 +01:00
parent 7e6b203a02
commit abaab927d9
211 changed files with 10839 additions and 7278 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env python3
"""Export lighthouse-story listening previews with the app's quiet atmosphere."""
import json
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
OUT = ROOT / 'artifacts/mara-qwen/listening'
OUT.mkdir(parents=True, exist_ok=True)
scripts = json.loads((ROOT / 'assets/narration/scripts.json').read_text())
tracks = json.loads((ROOT / 'assets/audio/narration_manifest.json').read_text())['tracks']
for page, scene, filename in [
('cottage.window', 'cottage', '01-by-the-cottage-window.wav'),
('campaign.8.before', 'tower', '02-at-the-lighthouse.wav'),
('campaign.10.after', 'tower', '03-the-light-returns.wav'),
]:
track = tracks[page]
assert track['engine'] == 'qwen3-voice-design'
assert track['text'] == next(r['text'] for r in scripts if r['pageId'] == page)
duration = track['durationMs'] / 1000
target = OUT / filename
subprocess.run([
'ffmpeg', '-v', 'error', '-y', '-i', str(ROOT / track['asset']),
'-stream_loop', '-1', '-i', str(ROOT / f'assets/audio/ambience_{scene}.wav'),
'-filter_complex', f'[1:a]volume=0.07,afade=t=in:d=0.5,'
f'afade=t=out:st={max(0, duration-.8)}:d=0.8[bed];'
'[0:a][bed]amix=inputs=2:duration=first:normalize=0[out]',
'-map', '[out]', '-c:a', 'pcm_s16le', str(target),
], check=True)
print(target)
(ROOT / 'artifacts/mara-qwen/listen.m3u').write_text(
'#EXTM3U\n' + '\n'.join('pages/' + tracks[r['pageId']]['file'] for r in scripts) + '\n')