Complete cottage notebook with narration and discovery-only artwork

This commit is contained in:
Hadrian Burkhardt
2026-11-01 00:18:34 +01:00
parent 36fbbce6ef
commit 6bd14a9e20
90 changed files with 2394 additions and 221 deletions
+16 -2
View File
@@ -5,14 +5,28 @@ from pathlib import Path
root=Path(__file__).resolve().parents[1]
source=root/'assets/narration';raw=root/'assets/audio'
canonical=json.loads((source/'scripts.json').read_text())
campaign=json.loads((root/'assets/campaign.json').read_text())['levels']
pages={p['id']:p for p in json.loads((root/'assets/notebook.json').read_text())['pages']}
manifest=json.loads((source/'manifest.json').read_text());runtime=json.loads((raw/'narration_manifest.json').read_text())
assert runtime['tracks']==manifest['tracks']
assert len(canonical)==5==len(manifest['tracks'])
assert len(canonical)==len(manifest['tracks'])
assert {r['pageId'] for r in canonical}==set(manifest['tracks'])
for record in canonical:
if record['pageId'].startswith('campaign.'):
_,index,phase=record['pageId'].split('.')
assert record['text']==campaign[int(index)][phase], 'Campaign narration is stale'
elif record.get('speaker')=='Narrator':
page=pages[record['pageId']]
expected=campaign[page['campaignIndex']][page['textSource']] if page.get('textSource') in ('before','after') else page['text']
assert record['text']==expected, 'Notebook narration is stale'
track=manifest['tracks'][record['pageId']]
assert track['text']==record['text']
assert track['textSha256']==hashlib.sha256(record['text'].encode()).hexdigest()
assert track['resource']==record['resource']
if record.get('speaker')=='Narrator':
assert track['speaker']=='Narrator' and track['voice']=='bm_george'
assert track['speed']==record['speed']
assert 'assets/audio/'+track['file'] in (root/'pubspec.yaml').read_text()
assert '\n\n'.join(cue['text'] for cue in track['cues'])==record['text']
previous=0
for cue in track['cues']:
@@ -33,4 +47,4 @@ for record in canonical:
print(f"PASS {record['pageId']}: {track['durationMs']/1000:.1f}s, WAV/master match, FLAC lossless, text/cues match")
for p in (root/'lib').rglob('*.dart'):
assert 'flutter_tts' not in p.read_text(),f'Device reader reintroduced in {p}'
print('All five recordings verified; bundled file playback only.')
print(f'All {len(canonical)} recordings verified; bundled file playback only.')