Migrate Lumen to Dart and Flutter 2.0
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Verify every bundled recording matches the current diary text and its WAV master."""
|
||||
import array, hashlib, json, math, subprocess, tempfile, wave
|
||||
import array, hashlib, json, subprocess, wave
|
||||
from pathlib import Path
|
||||
root=Path(__file__).resolve().parents[1]
|
||||
source=root/'assets/narration';raw=root/'app/src/main/res/raw'
|
||||
with tempfile.TemporaryDirectory(prefix='lumen-audio-text-') as temp:
|
||||
subprocess.run(['javac','-d',temp,str(root/'app/src/main/java/com/lumen/daily/StoryBook.java'),str(root/'scripts/ExportNarration.java')],check=True)
|
||||
canonical=json.loads(subprocess.check_output(['java','-cp',temp,'com.lumen.daily.ExportNarration']))
|
||||
assert canonical==json.loads((source/'scripts.json').read_text()),'Regenerate the script export after editing diary text'
|
||||
source=root/'assets/narration';raw=root/'assets/audio'
|
||||
canonical=json.loads((source/'scripts.json').read_text())
|
||||
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'])
|
||||
@@ -32,7 +29,6 @@ for record in canonical:
|
||||
assert decoded==master,'Runtime FLAC must preserve the WAV master exactly'
|
||||
assert track['flacSha256']==hashlib.sha256(flac.read_bytes()).hexdigest()
|
||||
print(f"PASS {record['pageId']}: {track['durationMs']/1000:.1f}s, lossless, text/cues match")
|
||||
for p in (root/'app/src/main/java').rglob('*.java'):
|
||||
assert 'android.speech.tts' not in p.read_text(),f'Android reader reintroduced in {p}'
|
||||
assert 'TTS_SERVICE' not in (root/'app/src/main/AndroidManifest.xml').read_text()
|
||||
print('All five recordings verified; no Android text-to-speech dependency.')
|
||||
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.')
|
||||
|
||||
Reference in New Issue
Block a user