Expand narrated story, preserve solved patterns, and add ambience
Connect the island story with new character memories and narrative transitions. Blend each solved symbol into its artwork and retain a replayable pattern stamp. Allow completed grids to be inspected after navigation and app restarts. Reduce campaign difficulty spikes and keep explained story hints free. Append 24 narrated continuations while preserving original PCM takes. Add four offline environmental loops with saved mute/volume controls, scene fades, narration ducking and lifecycle handling. Validation: 31 unit/widget tests, Flutter analysis, narration and soundscape asset checks, tablet discovery layouts and extended-audio integration, including simultaneous active voice and ambience mixer tracks.
This commit is contained in:
@@ -12,7 +12,9 @@ Android is the tested target. iOS project scaffolding and test AdMob configurati
|
|||||||
- A saved ribbon bookmark, opened note, inspected repair, viewed pages and current reading place.
|
- A saved ribbon bookmark, opened note, inspected repair, viewed pages and current reading place.
|
||||||
- Twelve 7×7 picture puzzles across three chapters, with overlapping-area deductions on entries 3–12. Chapters II and III retain their briefing/puzzle/reveal structure, with swipes between those pages too. Chapter contents shows four entries at a time. Reading ahead keeps unfinished boards and completion awards separate.
|
- Twelve 7×7 picture puzzles across three chapters, with overlapping-area deductions on entries 3–12. Chapters II and III retain their briefing/puzzle/reveal structure, with swipes between those pages too. Chapter contents shows four entries at a time. Reading ahead keeps unfinished boards and completion awards separate.
|
||||||
- Deterministic daily grids and generated Easy, Medium and Hard 5×5 practice. The grades measure deduction-chain depth, not expert-level difficulty. Every board has a unique solution and needs no guessing.
|
- Deterministic daily grids and generated Easy, Medium and Hard 5×5 practice. The grades measure deduction-chain depth, not expert-level difficulty. Every board has a unique solution and needs no guessing.
|
||||||
- Undo, one free explained hint per puzzle, then optional rewarded hints. Later hints require the AdMob reward callback. An unavailable ad never blocks the board.
|
- Undo and unlimited free explained hints in the story. Daily and classic puzzles have one free explained hint, then optional rewarded hints. Rewarded hints require the AdMob reward callback. An unavailable ad never blocks the board.
|
||||||
|
- Expanded story passages connect the harbour key, crossing, bell signals and reunion with Mara. All added passages are narrated; original takes continue seamlessly into the new sections.
|
||||||
|
- Solved patterns remain available when turning back from discoveries, including after restarting. Discoveries blend the exact pixel symbol into the watercolour, keep a small copy of the symbol visible, and offer a replay.
|
||||||
- Local daily streaks, independent difficulty levels and exactly-once puzzle completion awards.
|
- Local daily streaks, independent difficulty levels and exactly-once puzzle completion awards.
|
||||||
- AdMob/UMP consent, optional rewarded hints, practice interstitials after every fourth completion and one-time campaign chapter transitions. No ads interrupt opening notebook leaves or recorded readings.
|
- AdMob/UMP consent, optional rewarded hints, practice interstitials after every fourth completion and one-time campaign chapter transitions. No ads interrupt opening notebook leaves or recorded readings.
|
||||||
|
|
||||||
@@ -24,7 +26,9 @@ All app-created text uses the bundled Dancing Script handwriting font, including
|
|||||||
|
|
||||||
Campaign discoveries now support optional watercolour keepsakes declared in the campaign data. All twelve discoveries have illustrations, and the opening match memory uses the same match watercolour. Each object’s artwork appears only on its discovery leaf after its own pattern is solved. Entry pages, the earlier repair note and the closing leaf never display discovery art, even with completed progress. Pixel pictures are also hidden until solved and remain the fallback for missing artwork.
|
Campaign discoveries now support optional watercolour keepsakes declared in the campaign data. All twelve discoveries have illustrations, and the opening match memory uses the same match watercolour. Each object’s artwork appears only on its discovery leaf after its own pattern is solved. Entry pages, the earlier repair note and the closing leaf never display discovery art, even with completed progress. Pixel pictures are also hidden until solved and remain the fallback for missing artwork.
|
||||||
|
|
||||||
Twenty-eight fixed, pre-rendered synthetic recordings play from bundled PCM16 WAV files. Mara’s five original British-English diary readings are preserved; twenty-three guiding passages use a distinct narrator voice, covering the cottage entries/memories/closing leaf and the later campaign introductions and discoveries. All recordings are opt-in, labelled by speaker and support pause/resume, stop, replay, speed and passage highlighting. Page turns and backgrounding stop playback. WAV avoids the Huawei API 26 FLAC playback issue; archival FLACs stay out of the APK. There is no Android reader, runtime synthesis or audio download. See [narration provenance](assets/narration/README.md).
|
Twenty-eight fixed, pre-rendered synthetic recordings play from bundled PCM16 WAV files. Twenty-four readings include the expanded story; the original PCM takes are preserved, followed by the added narrator passages. A single Play control covers the whole page and highlighting follows both parts. Mara’s five original British-English diary takes are preserved; twenty-three guiding passages use a distinct narrator voice, covering the cottage entries/memories/closing leaf and the later campaign introductions and discoveries. All recordings are opt-in, labelled by speaker and support pause/resume, stop, replay, speed and passage highlighting. Page turns and backgrounding stop playback. WAV avoids the Huawei API 26 FLAC playback issue; archival FLACs stay out of the APK. There is no Android reader, runtime synthesis or audio download. See [narration provenance](assets/narration/README.md).
|
||||||
|
|
||||||
|
Four bundled, original sound textures accompany the story: air around the cottage, harbour water, the stream under the bridge and wind around the lighthouse. They loop quietly, fade when locations change and duck beneath narration. Sound & atmosphere offers a saved mute switch and independent atmosphere volume. Leaving the story or backgrounding the app stops them; readings never start automatically. These are procedurally rendered soundscapes, not field recordings. See [soundscape provenance](assets/audio/AMBIENCE.md).
|
||||||
|
|
||||||
## Build and run
|
## Build and run
|
||||||
|
|
||||||
@@ -61,6 +65,7 @@ The development release build currently uses the Android debug signing key so it
|
|||||||
flutter analyze
|
flutter analyze
|
||||||
flutter test
|
flutter test
|
||||||
python3 scripts/check_narration_assets.py
|
python3 scripts/check_narration_assets.py
|
||||||
|
python3 scripts/check_soundscape_assets.py
|
||||||
|
|
||||||
# Launch/playback/restart smoke test after installing the normal APK
|
# Launch/playback/restart smoke test after installing the normal APK
|
||||||
python3 scripts/check_flutter_install.py --serial YOUR_ANDROID_DEVICE
|
python3 scripts/check_flutter_install.py --serial YOUR_ANDROID_DEVICE
|
||||||
@@ -71,7 +76,7 @@ flutter drive --driver test_driver/integration_test.dart \
|
|||||||
--dart-define=QA_TEST=true -d YOUR_ANDROID_DEVICE
|
--dart-define=QA_TEST=true -d YOUR_ANDROID_DEVICE
|
||||||
```
|
```
|
||||||
|
|
||||||
The twenty unit/widget tests cover 40 Java reference boards (including signed 64-bit seeds), 300 graded generated boards, solver counts against 300 exhaustive small systems, all twelve campaign solutions, streaks, fresh progress, read-ahead, completion awards, campaign read-ahead restoration, gesture isolation, swipes over text and blank paper, cancelled drags, vertical scrolling, landscape and larger text; it also checks every cottage leaf with the real font at 1.5× text, all four hint controls, legacy route migration and exactly-once completion after restart. Reference parity protects the port’s rules; it is not used to migrate saves.
|
The thirty-one unit/widget tests cover 40 Java reference boards (including signed 64-bit seeds), 300 graded generated boards, solver counts against 300 exhaustive small systems, all twelve campaign solutions, bounded campaign comparison chains, solved-grid inspection after restart, discovery animation/replay, repeated free story hints, streaks, fresh progress, read-ahead, completion awards, campaign read-ahead restoration, gesture isolation, swipes over text and blank paper, cancelled drags, vertical scrolling, landscape and larger text; it also checks every cottage leaf with the real font at 1.5× text, all four hint controls, legacy route migration and exactly-once completion after restart. Reference parity protects the port’s rules; it is not used to migrate saves.
|
||||||
|
|
||||||
The physical-device integration test uses a disposable in-memory game plus an isolated QA disk round-trip. It plays all five real WAV files, checks pause/resume, explores the six leaves, verifies bookmarks/discoveries, solves match and lantern puzzles and checks exactly-once awards. Screenshots are saved in `artifacts/flutter-check/`. The release smoke script requires an active, unmuted 24 kHz media track in the tablet’s audio mixer as well as exercising the actual play/pause/resume UI and restores the last page after process restart, without injecting puzzle fixtures. The release build includes a targeted R8 keep rule for the database constructor used reflectively by AdMob’s WorkManager dependency. Advertising is disabled for the automated story tests; real UMP startup is checked separately in the normal build. Reward delivery, cancellation and ad no-fill still need manual release testing with your final AdMob configuration.
|
The physical-device integration test uses a disposable in-memory game plus an isolated QA disk round-trip. It plays all five real WAV files, checks pause/resume, explores the six leaves, verifies bookmarks/discoveries, solves match and lantern puzzles and checks exactly-once awards. Screenshots are saved in `artifacts/flutter-check/`. The release smoke script requires an active, unmuted 24 kHz media track in the tablet’s audio mixer as well as exercising the actual play/pause/resume UI and restores the last page after process restart, without injecting puzzle fixtures. The release build includes a targeted R8 keep rule for the database constructor used reflectively by AdMob’s WorkManager dependency. Advertising is disabled for the automated story tests; real UMP startup is checked separately in the normal build. Reward delivery, cancellation and ad no-fill still need manual release testing with your final AdMob configuration.
|
||||||
|
|
||||||
@@ -101,7 +106,7 @@ For Android, supply the app ID using Gradle property `ADMOB_APP_ID`. Rewarded/in
|
|||||||
See [ROADMAP.md](ROADMAP.md) for the proposed 30–40-leaf campaign, page variety and further exploration ideas. Smaller follow-ups and asset tasks are tracked in [TODO.md](TODO.md).
|
See [ROADMAP.md](ROADMAP.md) for the proposed 30–40-leaf campaign, page variety and further exploration ideas. Smaller follow-ups and asset tasks are tracked in [TODO.md](TODO.md).
|
||||||
|
|
||||||
|
|
||||||
Chapter I page records live in `assets/notebook.json`. The original six IDs and `story_v1_0`–`story_v1_3` puzzle keys are preserved. Existing cottage briefing, puzzle and reveal saves reopen on their corresponding leaves. Reading ahead never awards a puzzle completion; leaving the cottage opens Chapter II even when patterns remain unfinished. All seven added prose leaves have narrator recordings; the original five diary recordings remain unchanged.
|
Chapter I page records live in `assets/notebook.json`. The original six IDs and `story_v1_0`–`story_v1_3` puzzle keys are preserved. Existing cottage briefing, puzzle and reveal saves reopen on their corresponding leaves. Reading ahead never awards a puzzle completion; leaving the cottage opens Chapter II even when patterns remain unfinished. All seven added prose leaves have narrator recordings; the original five diary takes are retained as PCM within the expanded recordings.
|
||||||
|
|
||||||
To review the complete chapter on an isolated QA install, run `flutter drive --driver test_driver/integration_test.dart --target integration_test/cottage_test.dart --flavor qa --dart-define=QA_TEST=true -d YOUR_ANDROID_DEVICE`. This traverses all sixteen leaves, checks bookmarks/restart, rotates the compass puzzle at larger text, solves all four patterns and checks QA disk persistence. It saves eight screenshots in `artifacts/flutter-check/`.
|
To review the complete chapter on an isolated QA install, run `flutter drive --driver test_driver/integration_test.dart --target integration_test/cottage_test.dart --flavor qa --dart-define=QA_TEST=true -d YOUR_ANDROID_DEVICE`. This traverses all sixteen leaves, checks bookmarks/restart, rotates the compass puzzle at larger text, solves all four patterns and checks QA disk persistence. It saves eight screenshots in `artifacts/flutter-check/`.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# Environmental soundscapes
|
||||||
|
|
||||||
|
Four original, procedurally rendered sound textures ship as 24-second, 24 kHz mono PCM16 WAV loops. No third-party recordings, models, downloads or samples are used for these soundscapes. They are sound design approximations rather than field recordings.
|
||||||
|
|
||||||
|
| File | Scene | Texture |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `ambience_cottage.wav` | Cottage and homecoming story pages | Soft air through trees and quiet timber movement |
|
||||||
|
| `ambience_harbour.wav` | Boat, anchor and shore bell | Small swells and water washing against the harbour wall |
|
||||||
|
| `ambience_bridge.wav` | Stone bridge | Steady current with changing surface turbulence |
|
||||||
|
| `ambience_tower.wav` | Gear, lens and lighthouse | Low sheltered wind with higher gusts |
|
||||||
|
|
||||||
|
`scripts/render_ambience.py` uses seeded spectral noise, slow periodic envelopes and a smooth loop join. `ambience_manifest.json` records seeds, format, frame counts and SHA-256 hashes. Reproduce with the narration Python environment (NumPy and soundfile), then validate with the standard-library checker:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python scripts/render_ambience.py
|
||||||
|
python3 scripts/check_soundscape_assets.py
|
||||||
|
```
|
||||||
|
|
||||||
|
The app plays bundled files, with no synthesis at runtime. Atmosphere defaults on inside the story. Sound & atmosphere saves a separate mute switch and volume, independent of the narration controls. Scene changes fade over 240 ms. The atmosphere falls to a quarter of its usual gain under narration. Muting, leaving the story or backgrounding stops it; foregrounding restores only environmental audio. Narration remains opt-in. Audio interruptions and headphone removal pause the players.
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"method": "Original procedural sound textures rendered offline by scripts/render_ambience.py; no third-party samples.",
|
||||||
|
"tracks": {
|
||||||
|
"cottage": {
|
||||||
|
"file": "ambience_cottage.wav",
|
||||||
|
"sampleRate": 24000,
|
||||||
|
"channels": 1,
|
||||||
|
"durationMs": 24000,
|
||||||
|
"frames": 576000,
|
||||||
|
"seed": 104,
|
||||||
|
"wavSha256": "414c7cc08ec4cd646a420a53a02f4db46078b0f69730c448c3b85ffaf6cc7a6e"
|
||||||
|
},
|
||||||
|
"harbour": {
|
||||||
|
"file": "ambience_harbour.wav",
|
||||||
|
"sampleRate": 24000,
|
||||||
|
"channels": 1,
|
||||||
|
"durationMs": 24000,
|
||||||
|
"frames": 576000,
|
||||||
|
"seed": 205,
|
||||||
|
"wavSha256": "6098efaefad490d6a07d0ea7272fccc6108a4014aa90d2057d44e24343e26568"
|
||||||
|
},
|
||||||
|
"bridge": {
|
||||||
|
"file": "ambience_bridge.wav",
|
||||||
|
"sampleRate": 24000,
|
||||||
|
"channels": 1,
|
||||||
|
"durationMs": 24000,
|
||||||
|
"frames": 576000,
|
||||||
|
"seed": 306,
|
||||||
|
"wavSha256": "ceb2bbc32bcdd8c71b0be2f51b3cf11c7ea04dcc03954688f0f1dc6224856547"
|
||||||
|
},
|
||||||
|
"tower": {
|
||||||
|
"file": "ambience_tower.wav",
|
||||||
|
"sampleRate": 24000,
|
||||||
|
"channels": 1,
|
||||||
|
"durationMs": 24000,
|
||||||
|
"frames": 576000,
|
||||||
|
"seed": 407,
|
||||||
|
"wavSha256": "16b564bf644b72650987468b74519693793c781ead6759887758ab4113972e8c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
+41
-17
@@ -10,7 +10,9 @@
|
|||||||
"picture": "0011000011110000110000001000000100000010000001000",
|
"picture": "0011000011110000110000001000000100000010000001000",
|
||||||
"clues": "",
|
"clues": "",
|
||||||
"areas": "",
|
"areas": "",
|
||||||
"illustrationAsset": "assets/artwork/match-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/match-vignette-v1.png",
|
||||||
|
"beforeContinuation": "The notebook is open beside a cup with a blue rim. You remember that cup being too large for your hands. Now it looks small. Outside, the lighthouse is a dark line against the evening sky. Gran must already be up there; she never stayed home when the light needed tending.",
|
||||||
|
"afterContinuation": "You cup the flame, just as she taught you. The smell of the match brings back wet mittens drying by this hearth and Gran counting the seconds between thunder and lightning. You have come to help her after the storm. For the first time since arriving, you know where to begin."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "I · The keeper’s cottage",
|
"chapter": "I · The keeper’s cottage",
|
||||||
@@ -21,7 +23,9 @@
|
|||||||
"after": "The lantern is soot-black but sound. Its warm circle of light reaches the cottage door. Beneath the handle, Mara has scratched your initials.",
|
"after": "The lantern is soot-black but sound. Its warm circle of light reaches the cottage door. Beneath the handle, Mara has scratched your initials.",
|
||||||
"picture": "0011100001010001111100100010010101001000100111110",
|
"picture": "0011100001010001111100100010010101001000100111110",
|
||||||
"clues": "1,5,9,11",
|
"clues": "1,5,9,11",
|
||||||
"areas": ""
|
"areas": "",
|
||||||
|
"beforeContinuation": "You recognise the crooked handle before the rest of the drawing. As a child, you thought every lantern came with that little bandage of cloth. Beside the pattern Gran has drawn an arrow from the hearth to the door: a tiny journey, but a journey all the same.",
|
||||||
|
"afterContinuation": "There is oil in the reservoir and a clean spare wick in the drawer. Gran has left both within reach. You touch the initials under the handle. She added a second line beneath them years later, when you were tall enough to carry the lantern without dragging it against your knees."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "I · The keeper’s cottage",
|
"chapter": "I · The keeper’s cottage",
|
||||||
@@ -30,9 +34,11 @@
|
|||||||
"before": "‘Some clues belong to more than one place,’ Mara wrote. Compare the overlapping areas on this page; a shared cell counts in both. A loose floorboard waits by the door.",
|
"before": "‘Some clues belong to more than one place,’ Mara wrote. Compare the overlapping areas on this page; a shared cell counts in both. A loose floorboard waits by the door.",
|
||||||
"after": "A brass key turns up beneath the board. The tag reads ‘harbour store’. Someone prepared for a journey and never quite made it out of the cottage.",
|
"after": "A brass key turns up beneath the board. The tag reads ‘harbour store’. Someone prepared for a journey and never quite made it out of the cottage.",
|
||||||
"picture": "0011100010001001000100011100000100000011000001000",
|
"picture": "0011100010001001000100011100000100000011000001000",
|
||||||
"clues": "",
|
"clues": "2,9,16,24,25,32",
|
||||||
"areas": "1,2,4,3;3,2,2,4;3,2,2,3",
|
"areas": "1,2,4,3;3,2,2,4;3,2,2,3",
|
||||||
"illustrationAsset": "assets/artwork/brass-key-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/brass-key-vignette-v1.png",
|
||||||
|
"beforeContinuation": "The floorboard lifts where a nail has worked loose. Under it is the place Gran called her sensible hiding place, though everyone in the family knew about it. You used to keep a shell there. This time your fingers find a tag, its string wound carefully around something cold.",
|
||||||
|
"afterContinuation": "At first the abandoned preparations worry you. Then you notice today's date on a pencilled list: oil, spare wick, tea. Gran must have gone ahead to the tower, leaving the store key for you. The harbour store holds the little things a crossing needs. She expects you to follow."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "I · The keeper’s cottage",
|
"chapter": "I · The keeper’s cottage",
|
||||||
@@ -43,7 +49,9 @@
|
|||||||
"picture": "0001000001110001010101111111010101000111000001000",
|
"picture": "0001000001110001010101111111010101000111000001000",
|
||||||
"clues": "15,36",
|
"clues": "15,36",
|
||||||
"areas": "1,3,2,2;3,2,3,3;2,0,3,5",
|
"areas": "1,3,2,2;3,2,3,3;2,0,3,5",
|
||||||
"illustrationAsset": "assets/artwork/compass-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/compass-vignette-v1.png",
|
||||||
|
"beforeContinuation": "You hold the notebook towards the window. Beneath the compass drawing, a faint line follows the old lane down to the harbour steps. You know the road in daylight. Tonight you will need to recognise smaller things: the broken gate, the bend in the wall, the smell of the tide.",
|
||||||
|
"afterContinuation": "The needle trembles when you move your hand, then steadies. Inside the lid you find a worn patch where Gran's thumb rested through years of evening rounds. You follow the same motion without meaning to. The notebook goes inside your coat; the lantern stays in your hand."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "II · Across the tide",
|
"chapter": "II · Across the tide",
|
||||||
@@ -52,9 +60,11 @@
|
|||||||
"before": "The tide has covered the causeway. A shape knocks gently against the harbour steps. Mara’s notebook has a page for this crossing too.",
|
"before": "The tide has covered the causeway. A shape knocks gently against the harbour steps. Mara’s notebook has a page for this crossing too.",
|
||||||
"after": "The little boat is still tied fast. You bail out the rainwater, set the lantern in the bow, and push away from the steps.",
|
"after": "The little boat is still tied fast. You bail out the rainwater, set the lantern in the bow, and push away from the steps.",
|
||||||
"picture": "0001000000110000011100001000111111101111101000001",
|
"picture": "0001000000110000011100001000111111101111101000001",
|
||||||
"clues": "",
|
"clues": "3,9",
|
||||||
"areas": "0,3,5,2;3,1,3,3;2,2,4,4",
|
"areas": "0,3,5,2;3,1,3,3;2,2,4,4",
|
||||||
"illustrationAsset": "assets/artwork/little-boat-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/little-boat-vignette-v1.png",
|
||||||
|
"beforeContinuation": "Before going down the steps, you try the brass key in the harbour store. Lift the latch, then turn: Gran's advice works here too. Inside are a bailer, two oars and an oilskin folded over a sack of dry kindling. A toolbox waits beneath the bench, with your name chalked on its lid. You carry it down to the boat with the oars and bailer, then lock the door behind you. On the notebook's margin, Gran has marked a landing sheltered beneath the hill.",
|
||||||
|
"afterContinuation": "The knot yields when you stop pulling at the wrong loop. You laugh softly; Gran would have noticed. In the water, the cottage window breaks into little squares of reflected gold. You row towards the sheltered landing, watching that reflection grow smaller without quite disappearing."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "II · Across the tide",
|
"chapter": "II · Across the tide",
|
||||||
@@ -65,7 +75,9 @@
|
|||||||
"picture": "0011100001010000111000001000100100101010100011100",
|
"picture": "0011100001010000111000001000100100101010100011100",
|
||||||
"clues": "11,36,40",
|
"clues": "11,36,40",
|
||||||
"areas": "2,3,3,3;2,1,4,2;1,1,3,4",
|
"areas": "2,3,3,3;2,1,4,2;1,1,3,4",
|
||||||
"illustrationAsset": "assets/artwork/anchor-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/anchor-vignette-v1.png",
|
||||||
|
"beforeContinuation": "You rest the oars inside the boat. The landing is close, but the current slides across its mouth. Beneath the seat, a coil of rope leads to the weight in Gran's drawing. You remember her showing you this quiet waiting place when the tide ran too strongly to come straight in.",
|
||||||
|
"afterContinuation": "You wait until the current eases, then draw up the anchor and row the short distance to the landing. The bell sounds again, moved by the wind. It is the bell from Gran's note. Beyond it, the path climbs towards a window with a small, steady light."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "II · Across the tide",
|
"chapter": "II · Across the tide",
|
||||||
@@ -74,9 +86,11 @@
|
|||||||
"before": "You land beneath the lighthouse hill. The old crossing is hidden by reeds. Mara marked its outline long before the storm.",
|
"before": "You land beneath the lighthouse hill. The old crossing is hidden by reeds. Mara marked its outline long before the storm.",
|
||||||
"after": "The bridge is intact. You cross with the lantern held high. On the far bank, a fresh bootprint tells you someone else has passed this way.",
|
"after": "The bridge is intact. You cross with the lantern held high. On the far bank, a fresh bootprint tells you someone else has passed this way.",
|
||||||
"picture": "0000000011111011000111000001100000111111110000000",
|
"picture": "0000000011111011000111000001100000111111110000000",
|
||||||
"clues": "",
|
"clues": "15,33",
|
||||||
"areas": "2,1,3,5;0,2,5,3;2,3,2,2",
|
"areas": "2,1,3,5;0,2,5,3;2,3,2,2",
|
||||||
"illustrationAsset": "assets/artwork/stone-bridge-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/stone-bridge-vignette-v1.png",
|
||||||
|
"beforeContinuation": "The boat is tied above the tide line. Between the landing and the path lies a narrow stream, swollen with rain. You remember leaping across it once and losing a boot. Gran had carried you home, pretending you weighed as much as a sack of coal. Tonight you are grateful for the bridge.",
|
||||||
|
"afterContinuation": "The print points towards the tower. Beside it is the round mark of Gran's walking stick. She has taken this path with her supplies before you, testing the stones as she went. You set your foot beside hers. The handrail is wet, but it holds."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "II · Across the tide",
|
"chapter": "II · Across the tide",
|
||||||
@@ -87,7 +101,9 @@
|
|||||||
"after": "One clear note travels into the fog. Two notes answer from the hill. Someone is waiting at the lighthouse.",
|
"after": "One clear note travels into the fog. Two notes answer from the hill. Someone is waiting at the lighthouse.",
|
||||||
"picture": "0001000001110000101000100010010001011111110001000",
|
"picture": "0001000001110000101000100010010001011111110001000",
|
||||||
"clues": "2",
|
"clues": "2",
|
||||||
"areas": "3,2,3,3;2,0,4,4;0,3,5,2"
|
"areas": "3,2,3,3;2,0,4,4;0,3,5,2",
|
||||||
|
"beforeContinuation": "This is the shore bell, within sight of the lighthouse when the weather is clear. Gran's note said to ring twice. You take up the slack in the rope before pulling; the first stroke will tell you whether the clapper is free. You hope she is listening.",
|
||||||
|
"afterContinuation": "You give the two strokes she asked for. After a pause, the answering pair comes again from the smaller bell at the tower door. A lantern lifts in the window. You raise yours in return, and the last part of the climb no longer feels so lonely."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "III · The last light",
|
"chapter": "III · The last light",
|
||||||
@@ -96,9 +112,11 @@
|
|||||||
"before": "Mara opens the lighthouse door. ‘I knew you’d find the notebook,’ she says. The storm stopped the turning mechanism. Together, you lay out its scattered parts.",
|
"before": "Mara opens the lighthouse door. ‘I knew you’d find the notebook,’ she says. The storm stopped the turning mechanism. Together, you lay out its scattered parts.",
|
||||||
"after": "The missing gear slips into place. You turn the handle; the mechanism answers with a familiar, steady ticking. Mara smiles without looking up.",
|
"after": "The missing gear slips into place. You turn the handle; the mechanism answers with a familiar, steady ticking. Mara smiles without looking up.",
|
||||||
"picture": "0010100011111011000110101010110001101111100010100",
|
"picture": "0010100011111011000110101010110001101111100010100",
|
||||||
"clues": "9,24",
|
"clues": "2,4,9,10,24,43",
|
||||||
"areas": "2,3,3,3;1,3,5,3;1,2,4,3",
|
"areas": "2,3,3,3;1,3,5,3;1,2,4,3",
|
||||||
"illustrationAsset": "assets/artwork/missing-gear-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/missing-gear-vignette-v1.png",
|
||||||
|
"beforeContinuation": "Her hands are cold when she takes yours. 'You brought the old lantern,' she says, touching its mended handle. She tells you she came up before the tide covered the causeway. The tower is safe, but a loose gear stopped the lamp from turning. She could carry the supplies or the heavy toolbox, never both. You set the box between you.",
|
||||||
|
"afterContinuation": "'Your grandfather used to listen for that sound from the stairs,' she says. For a while you both listen. The little ticking fills the room, quieter than the storm ever was. Then Gran gives you a cloth and points upstairs. There is still the glass to clean."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "III · The last light",
|
"chapter": "III · The last light",
|
||||||
@@ -107,9 +125,11 @@
|
|||||||
"before": "The great lens is clouded with salt. Mara holds the lantern while you work. The areas overlap like the rings in the glass; compare them carefully.",
|
"before": "The great lens is clouded with salt. Mara holds the lantern while you work. The areas overlap like the rings in the glass; compare them carefully.",
|
||||||
"after": "You wipe the last salt from the lens. The lantern’s tiny flame stretches into a bright arc across the walls. Everything is ready.",
|
"after": "You wipe the last salt from the lens. The lantern’s tiny flame stretches into a bright arc across the walls. Everything is ready.",
|
||||||
"picture": "0011100010001010010011001101100100101000100011100",
|
"picture": "0011100010001010010011001101100100101000100011100",
|
||||||
"clues": "7,13,36,40",
|
"clues": "7,8,13,36,40",
|
||||||
"areas": "1,2,5,3;2,3,3,2;2,2,3,2",
|
"areas": "1,2,5,3;2,3,3,2;2,2,3,2",
|
||||||
"illustrationAsset": "assets/artwork/beacon-lens-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/beacon-lens-vignette-v1.png",
|
||||||
|
"beforeContinuation": "You climb past the narrow windows with the oilskin over your arm. Gran follows slowly, carrying the lantern. At the top she pauses to catch her breath and lets you take the next bundle. You used to hurry to keep up with her on these stairs. Tonight you match your steps to hers.",
|
||||||
|
"afterContinuation": "Through the cleared glass you can see the sheltered landing and the black thread of the stream. Gran checks the main lamp's oil feed while you put away the cloths. For the first time tonight, the whole route fits into one view. Every small thing you found has brought you here."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "III · The last light",
|
"chapter": "III · The last light",
|
||||||
@@ -120,7 +140,9 @@
|
|||||||
"picture": "0001000001110011111110011100001010001101101111111",
|
"picture": "0001000001110011111110011100001010001101101111111",
|
||||||
"clues": "",
|
"clues": "",
|
||||||
"areas": "1,3,4,2;0,3,2,2;2,2,4,2",
|
"areas": "1,3,4,2;0,3,2,2;2,2,4,2",
|
||||||
"illustrationAsset": "assets/artwork/lighthouse-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/lighthouse-vignette-v1.png",
|
||||||
|
"beforeContinuation": "The lantern lights Gran's hands as she checks the wick of the great oil lamp. Its flame will stay here, beside the spare matches; the beacon has its own much larger burner. She lights it, checks the glass once more, and nods towards the turning handle. This time she stands beside you instead of doing it herself.",
|
||||||
|
"afterContinuation": "Gran waits for the beam to return across the window. Only then does she let out her breath. 'There,' she says. No speech, no grand ceremony. She rests her hand over yours for one turn of the handle, and you feel the weight of the work she has done all these years."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"chapter": "III · The last light",
|
"chapter": "III · The last light",
|
||||||
@@ -131,7 +153,9 @@
|
|||||||
"picture": "0001000001110001111101111111010001001010100111110",
|
"picture": "0001000001110001111101111111010001001010100111110",
|
||||||
"clues": "",
|
"clues": "",
|
||||||
"areas": "0,1,6,2;2,3,4,3;0,2,4,3",
|
"areas": "0,1,6,2;2,3,4,3;0,2,4,3",
|
||||||
"illustrationAsset": "assets/artwork/home-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/home-vignette-v1.png",
|
||||||
|
"beforeContinuation": "You leave the beacon running steadily. On the walk home, Gran names the things to mend tomorrow: a hinge, the store's gutter, that stubborn cottage latch. You add the loose floorboard. She says it has been loose for thirty years, but she hands you the key anyway.",
|
||||||
|
"afterContinuation": "The blue cup waits where she left it. While the kettle warms, you add tomorrow's tide time beneath your drawing. Gran reads it over your shoulder and nods. The notebook has room for repairs, crossings and ordinary evenings. You turn back once to the first small light, then leave a ribbon at the page you will need tomorrow."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Bundled diary readings and guiding narration
|
# Bundled diary readings and guiding narration
|
||||||
|
|
||||||
Twenty-eight fixed recordings accompany the story. Mara’s five original diary readings use `bf_emma` (British female); twenty-three guiding passages use a distinct `bm_george` narrator (British male). These are **synthetic recordings rendered during development**, not human voice-actor recordings. The app plays bundled files through just_audio, with no speech model, Android reader, runtime synthesis or download. Mara’s original WAV masters remain unchanged.
|
Twenty-eight fixed recordings accompany the story. Mara’s five original diary readings use `bf_emma` (British female); twenty-three guiding passages use a distinct `bm_george` narrator (British male). These are **synthetic recordings rendered during development**, not human voice-actor recordings. The app plays bundled files through just_audio, with no speech model, Android reader, runtime synthesis or download. The original PCM takes remain unchanged as prefixes of the expanded masters. Twenty-four recordings now append the complete new story passages in the narrator voice; the other four recordings remain unchanged.
|
||||||
|
|
||||||
- `scripts.json`: canonical scripts with stable IDs, speaker, voice and rendering speed. Narrator passages match notebook entry/memory/closing text or the later campaign before/after passages.
|
- `scripts.json`: canonical scripts with stable IDs, speaker, voice and rendering speed. Each complete script matches the displayed original text plus its continuation. Expanded records retain `baseText`, `continuation` and `continuationSpeaker`; the renderer records the original frame count and PCM checksum. The window and match memory keep Mara’s diary take, then switch to the narrator for the added present-day action.
|
||||||
- `wav/`: reviewable 24 kHz mono PCM16 WAV masters.
|
- `wav/`: reviewable 24 kHz mono PCM16 WAV masters.
|
||||||
- `manifest.json`: model/voice checksums, generator versions, exact scripts, passage timings and WAV and FLAC checksums.
|
- `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_*.wav`: bundled PCM16 copies, byte-identical to the WAV masters.
|
||||||
@@ -19,6 +19,8 @@ Use Python 3.12, dependencies pinned in `requirements.txt` and ffmpeg. Keep mode
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
python scripts/render_narration.py --model /path/to/kokoro-v1.0.onnx --voices /path/to/voices-v1.0.bin
|
python scripts/render_narration.py --model /path/to/kokoro-v1.0.onnx --voices /path/to/voices-v1.0.bin
|
||||||
|
# Append new narrator passages while preserving existing PCM takes:
|
||||||
|
python scripts/render_narration.py --model /path/to/kokoro-v1.0.onnx --voices /path/to/voices-v1.0.bin --append-continuations
|
||||||
python3 scripts/check_narration_assets.py
|
python3 scripts/check_narration_assets.py
|
||||||
|
|
||||||
# Regenerate only guiding narration, preserving Mara’s existing takes:
|
# Regenerate only guiding narration, preserving Mara’s existing takes:
|
||||||
@@ -32,4 +34,4 @@ A future actor recording can replace the masters and bundled assets while preser
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||
The seven cottage narrator recordings cover the lantern/key/compass entries and memories and the closing threshold leaf. Sixteen more cover the before/after passages for campaign levels 4–11. Puzzle instruction leaves remain unvoiced. On-screen labels distinguish “Mara · diary reading” from “Narrator · recorded story”; playback is opt-in and stops on navigation or backgrounding. Cue highlighting follows the exact displayed passage.
|
The seven cottage narrator recordings cover the lantern/key/compass entries and memories and the closing threshold leaf. Sixteen more cover the before/after passages for campaign levels 4–11. Puzzle instruction leaves remain unvoiced. On-screen labels distinguish “Mara · diary reading” from “Narrator · recorded story”; playback is opt-in and stops on navigation or backgrounding. Cue highlighting follows both displayed passages. One Play/Pause/Resume/Replay control covers the whole page, and the speaker label follows per-cue voice changes. Original PCM-prefix hashes are checked alongside full-track checksums.
|
||||||
|
|||||||
+496
-197
File diff suppressed because it is too large
Load Diff
+120
-48
@@ -10,18 +10,24 @@
|
|||||||
{
|
{
|
||||||
"pageId": "cottage.window",
|
"pageId": "cottage.window",
|
||||||
"resource": "narration_cottage_window",
|
"resource": "narration_cottage_window",
|
||||||
"text": "The wind has finally gone quiet. I have put the blue cup by the window, where you always liked to sit.\n\nThe latch still sticks. Lift it a little before you turn it. Some things on this island need a gentle hand, not a stronger one.\n\nIf you arrive after dark, there is something in the little drawer beside the hearth.",
|
"text": "The wind has finally gone quiet. I have put the blue cup by the window, where you always liked to sit.\n\nThe latch still sticks. Lift it a little before you turn it. Some things on this island need a gentle hand, not a stronger one.\n\nIf you arrive after dark, there is something in the little drawer beside the hearth.\n\nYou find the message on the table, held flat by the blue cup. Gran wrote it before heading to the lighthouse with the first supplies. You have come across from the mainland to help after the storm; she has left this familiar room ready for your arrival. The notebook is her way of walking the island with you, even while she waits at the tower.",
|
||||||
"speaker": "Mara",
|
"speaker": "Mara",
|
||||||
"voice": "bf_emma",
|
"voice": "bf_emma",
|
||||||
"speed": 0.82
|
"speed": 0.82,
|
||||||
|
"baseText": "The wind has finally gone quiet. I have put the blue cup by the window, where you always liked to sit.\n\nThe latch still sticks. Lift it a little before you turn it. Some things on this island need a gentle hand, not a stronger one.\n\nIf you arrive after dark, there is something in the little drawer beside the hearth.",
|
||||||
|
"continuation": "You find the message on the table, held flat by the blue cup. Gran wrote it before heading to the lighthouse with the first supplies. You have come across from the mainland to help after the storm; she has left this familiar room ready for your arrival. The notebook is her way of walking the island with you, even while she waits at the tower.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "cottage.match.memory",
|
"pageId": "cottage.match.memory",
|
||||||
"resource": "narration_cottage_match_memory",
|
"resource": "narration_cottage_match_memory",
|
||||||
"text": "You used to insist on lighting the evening lantern yourself. I held the matchbox, and you held your breath.\n\nOnce, you asked how such a little flame could help anyone out at sea.\n\nIt cannot, I told you. But it can help us find the next light.\n\nI kept one dry match in a tin after that. Just in case.",
|
"text": "You used to insist on lighting the evening lantern yourself. I held the matchbox, and you held your breath.\n\nOnce, you asked how such a little flame could help anyone out at sea.\n\nIt cannot, I told you. But it can help us find the next light.\n\nI kept one dry match in a tin after that. Just in case.\n\nYou cup the flame, just as she taught you. The smell of the match brings back wet mittens drying by this hearth and Gran counting the seconds between thunder and lightning. You have come to help her after the storm. For the first time since arriving, you know where to begin.",
|
||||||
"speaker": "Mara",
|
"speaker": "Mara",
|
||||||
"voice": "bf_emma",
|
"voice": "bf_emma",
|
||||||
"speed": 0.82
|
"speed": 0.82,
|
||||||
|
"baseText": "You used to insist on lighting the evening lantern yourself. I held the matchbox, and you held your breath.\n\nOnce, you asked how such a little flame could help anyone out at sea.\n\nIt cannot, I told you. But it can help us find the next light.\n\nI kept one dry match in a tin after that. Just in case.",
|
||||||
|
"continuation": "You cup the flame, just as she taught you. The smell of the match brings back wet mittens drying by this hearth and Gran counting the seconds between thunder and lightning. You have come to help her after the storm. For the first time since arriving, you know where to begin.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "cottage.folded.note",
|
"pageId": "cottage.folded.note",
|
||||||
@@ -42,50 +48,68 @@
|
|||||||
{
|
{
|
||||||
"pageId": "cottage.lantern.entry",
|
"pageId": "cottage.lantern.entry",
|
||||||
"resource": "narration_cottage_lantern_entry",
|
"resource": "narration_cottage_lantern_entry",
|
||||||
"text": "A small flame will not survive the wind. Mara’s next page shows what she carried on her evening rounds.",
|
"text": "A small flame will not survive the wind. Mara’s next page shows what she carried on her evening rounds.\n\nYou recognise the crooked handle before the rest of the drawing. As a child, you thought every lantern came with that little bandage of cloth. Beside the pattern Gran has drawn an arrow from the hearth to the door: a tiny journey, but a journey all the same.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "A small flame will not survive the wind. Mara’s next page shows what she carried on her evening rounds.",
|
||||||
|
"continuation": "You recognise the crooked handle before the rest of the drawing. As a child, you thought every lantern came with that little bandage of cloth. Beside the pattern Gran has drawn an arrow from the hearth to the door: a tiny journey, but a journey all the same.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "cottage.lantern.memory",
|
"pageId": "cottage.lantern.memory",
|
||||||
"resource": "narration_cottage_lantern_memory",
|
"resource": "narration_cottage_lantern_memory",
|
||||||
"text": "The lantern is soot-black but sound. Its warm circle of light reaches the cottage door. Beneath the handle, Mara has scratched your initials.",
|
"text": "The lantern is soot-black but sound. Its warm circle of light reaches the cottage door. Beneath the handle, Mara has scratched your initials.\n\nThere is oil in the reservoir and a clean spare wick in the drawer. Gran has left both within reach. You touch the initials under the handle. She added a second line beneath them years later, when you were tall enough to carry the lantern without dragging it against your knees.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The lantern is soot-black but sound. Its warm circle of light reaches the cottage door. Beneath the handle, Mara has scratched your initials.",
|
||||||
|
"continuation": "There is oil in the reservoir and a clean spare wick in the drawer. Gran has left both within reach. You touch the initials under the handle. She added a second line beneath them years later, when you were tall enough to carry the lantern without dragging it against your knees.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "cottage.key.entry",
|
"pageId": "cottage.key.entry",
|
||||||
"resource": "narration_cottage_key_entry",
|
"resource": "narration_cottage_key_entry",
|
||||||
"text": "‘Some clues belong to more than one place,’ Mara wrote. Compare the overlapping areas on this page; a shared cell counts in both. A loose floorboard waits by the door.",
|
"text": "‘Some clues belong to more than one place,’ Mara wrote. Compare the overlapping areas on this page; a shared cell counts in both. A loose floorboard waits by the door.\n\nThe floorboard lifts where a nail has worked loose. Under it is the place Gran called her sensible hiding place, though everyone in the family knew about it. You used to keep a shell there. This time your fingers find a tag, its string wound carefully around something cold.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "‘Some clues belong to more than one place,’ Mara wrote. Compare the overlapping areas on this page; a shared cell counts in both. A loose floorboard waits by the door.",
|
||||||
|
"continuation": "The floorboard lifts where a nail has worked loose. Under it is the place Gran called her sensible hiding place, though everyone in the family knew about it. You used to keep a shell there. This time your fingers find a tag, its string wound carefully around something cold.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "cottage.key.memory",
|
"pageId": "cottage.key.memory",
|
||||||
"resource": "narration_cottage_key_memory",
|
"resource": "narration_cottage_key_memory",
|
||||||
"text": "A brass key turns up beneath the board. The tag reads ‘harbour store’. Someone prepared for a journey and never quite made it out of the cottage.",
|
"text": "A brass key turns up beneath the board. The tag reads ‘harbour store’. Someone prepared for a journey and never quite made it out of the cottage.\n\nAt first the abandoned preparations worry you. Then you notice today's date on a pencilled list: oil, spare wick, tea. Gran must have gone ahead to the tower, leaving the store key for you. The harbour store holds the little things a crossing needs. She expects you to follow.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "A brass key turns up beneath the board. The tag reads ‘harbour store’. Someone prepared for a journey and never quite made it out of the cottage.",
|
||||||
|
"continuation": "At first the abandoned preparations worry you. Then you notice today's date on a pencilled list: oil, spare wick, tea. Gran must have gone ahead to the tower, leaving the store key for you. The harbour store holds the little things a crossing needs. She expects you to follow.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "cottage.compass.entry",
|
"pageId": "cottage.compass.entry",
|
||||||
"resource": "narration_cottage_compass_entry",
|
"resource": "narration_cottage_compass_entry",
|
||||||
"text": "The lane has vanished beneath fallen branches. One last page in the cottage points you towards the harbour. Use what the areas share to work out what lies outside them.",
|
"text": "The lane has vanished beneath fallen branches. One last page in the cottage points you towards the harbour. Use what the areas share to work out what lies outside them.\n\nYou hold the notebook towards the window. Beneath the compass drawing, a faint line follows the old lane down to the harbour steps. You know the road in daylight. Tonight you will need to recognise smaller things: the broken gate, the bend in the wall, the smell of the tide.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The lane has vanished beneath fallen branches. One last page in the cottage points you towards the harbour. Use what the areas share to work out what lies outside them.",
|
||||||
|
"continuation": "You hold the notebook towards the window. Beneath the compass drawing, a faint line follows the old lane down to the harbour steps. You know the road in daylight. Tonight you will need to recognise smaller things: the broken gate, the bend in the wall, the smell of the tide.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "cottage.compass.memory",
|
"pageId": "cottage.compass.memory",
|
||||||
"resource": "narration_cottage_compass_memory",
|
"resource": "narration_cottage_compass_memory",
|
||||||
"text": "The compass needle settles towards the sea. Tucked inside its lid is a note: ‘When the path disappears, keep your bearings.’ You step into the rain.",
|
"text": "The compass needle settles towards the sea. Tucked inside its lid is a note: ‘When the path disappears, keep your bearings.’ You step into the rain.\n\nThe needle trembles when you move your hand, then steadies. Inside the lid you find a worn patch where Gran's thumb rested through years of evening rounds. You follow the same motion without meaning to. The notebook goes inside your coat; the lantern stays in your hand.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The compass needle settles towards the sea. Tucked inside its lid is a note: ‘When the path disappears, keep your bearings.’ You step into the rain.",
|
||||||
|
"continuation": "The needle trembles when you move your hand, then steadies. Inside the lid you find a worn patch where Gran's thumb rested through years of evening rounds. You follow the same motion without meaning to. The notebook goes inside your coat; the lantern stays in your hand.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "cottage.threshold",
|
"pageId": "cottage.threshold",
|
||||||
@@ -98,129 +122,177 @@
|
|||||||
{
|
{
|
||||||
"pageId": "campaign.4.before",
|
"pageId": "campaign.4.before",
|
||||||
"resource": "narration_campaign_4_before",
|
"resource": "narration_campaign_4_before",
|
||||||
"text": "The tide has covered the causeway. A shape knocks gently against the harbour steps. Mara’s notebook has a page for this crossing too.",
|
"text": "The tide has covered the causeway. A shape knocks gently against the harbour steps. Mara’s notebook has a page for this crossing too.\n\nBefore going down the steps, you try the brass key in the harbour store. Lift the latch, then turn: Gran's advice works here too. Inside are a bailer, two oars and an oilskin folded over a sack of dry kindling. A toolbox waits beneath the bench, with your name chalked on its lid. You carry it down to the boat with the oars and bailer, then lock the door behind you. On the notebook's margin, Gran has marked a landing sheltered beneath the hill.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The tide has covered the causeway. A shape knocks gently against the harbour steps. Mara’s notebook has a page for this crossing too.",
|
||||||
|
"continuation": "Before going down the steps, you try the brass key in the harbour store. Lift the latch, then turn: Gran's advice works here too. Inside are a bailer, two oars and an oilskin folded over a sack of dry kindling. A toolbox waits beneath the bench, with your name chalked on its lid. You carry it down to the boat with the oars and bailer, then lock the door behind you. On the notebook's margin, Gran has marked a landing sheltered beneath the hill.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.4.after",
|
"pageId": "campaign.4.after",
|
||||||
"resource": "narration_campaign_4_after",
|
"resource": "narration_campaign_4_after",
|
||||||
"text": "The little boat is still tied fast. You bail out the rainwater, set the lantern in the bow, and push away from the steps.",
|
"text": "The little boat is still tied fast. You bail out the rainwater, set the lantern in the bow, and push away from the steps.\n\nThe knot yields when you stop pulling at the wrong loop. You laugh softly; Gran would have noticed. In the water, the cottage window breaks into little squares of reflected gold. You row towards the sheltered landing, watching that reflection grow smaller without quite disappearing.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The little boat is still tied fast. You bail out the rainwater, set the lantern in the bow, and push away from the steps.",
|
||||||
|
"continuation": "The knot yields when you stop pulling at the wrong loop. You laugh softly; Gran would have noticed. In the water, the cottage window breaks into little squares of reflected gold. You row towards the sheltered landing, watching that reflection grow smaller without quite disappearing.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.5.before",
|
"pageId": "campaign.5.before",
|
||||||
"resource": "narration_campaign_5_before",
|
"resource": "narration_campaign_5_before",
|
||||||
"text": "The current tugs you towards the outer rocks. Something heavy is tangled beneath the seat. The pattern tells you what to reach for.",
|
"text": "The current tugs you towards the outer rocks. Something heavy is tangled beneath the seat. The pattern tells you what to reach for.\n\nYou rest the oars inside the boat. The landing is close, but the current slides across its mouth. Beneath the seat, a coil of rope leads to the weight in Gran's drawing. You remember her showing you this quiet waiting place when the tide ran too strongly to come straight in.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The current tugs you towards the outer rocks. Something heavy is tangled beneath the seat. The pattern tells you what to reach for.",
|
||||||
|
"continuation": "You rest the oars inside the boat. The landing is close, but the current slides across its mouth. Beneath the seat, a coil of rope leads to the weight in Gran's drawing. You remember her showing you this quiet waiting place when the tide ran too strongly to come straight in.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.5.after",
|
"pageId": "campaign.5.after",
|
||||||
"resource": "narration_campaign_5_after",
|
"resource": "narration_campaign_5_after",
|
||||||
"text": "The anchor catches. The boat swings into calmer water. In the pause, you hear a bell somewhere beyond the fog.",
|
"text": "The anchor catches. The boat swings into calmer water. In the pause, you hear a bell somewhere beyond the fog.\n\nYou wait until the current eases, then draw up the anchor and row the short distance to the landing. The bell sounds again, moved by the wind. It is the bell from Gran's note. Beyond it, the path climbs towards a window with a small, steady light.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The anchor catches. The boat swings into calmer water. In the pause, you hear a bell somewhere beyond the fog.",
|
||||||
|
"continuation": "You wait until the current eases, then draw up the anchor and row the short distance to the landing. The bell sounds again, moved by the wind. It is the bell from Gran's note. Beyond it, the path climbs towards a window with a small, steady light.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.6.before",
|
"pageId": "campaign.6.before",
|
||||||
"resource": "narration_campaign_6_before",
|
"resource": "narration_campaign_6_before",
|
||||||
"text": "You land beneath the lighthouse hill. The old crossing is hidden by reeds. Mara marked its outline long before the storm.",
|
"text": "You land beneath the lighthouse hill. The old crossing is hidden by reeds. Mara marked its outline long before the storm.\n\nThe boat is tied above the tide line. Between the landing and the path lies a narrow stream, swollen with rain. You remember leaping across it once and losing a boot. Gran had carried you home, pretending you weighed as much as a sack of coal. Tonight you are grateful for the bridge.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "You land beneath the lighthouse hill. The old crossing is hidden by reeds. Mara marked its outline long before the storm.",
|
||||||
|
"continuation": "The boat is tied above the tide line. Between the landing and the path lies a narrow stream, swollen with rain. You remember leaping across it once and losing a boot. Gran had carried you home, pretending you weighed as much as a sack of coal. Tonight you are grateful for the bridge.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.6.after",
|
"pageId": "campaign.6.after",
|
||||||
"resource": "narration_campaign_6_after",
|
"resource": "narration_campaign_6_after",
|
||||||
"text": "The bridge is intact. You cross with the lantern held high. On the far bank, a fresh bootprint tells you someone else has passed this way.",
|
"text": "The bridge is intact. You cross with the lantern held high. On the far bank, a fresh bootprint tells you someone else has passed this way.\n\nThe print points towards the tower. Beside it is the round mark of Gran's walking stick. She has taken this path with her supplies before you, testing the stones as she went. You set your foot beside hers. The handrail is wet, but it holds.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The bridge is intact. You cross with the lantern held high. On the far bank, a fresh bootprint tells you someone else has passed this way.",
|
||||||
|
"continuation": "The print points towards the tower. Beside it is the round mark of Gran's walking stick. She has taken this path with her supplies before you, testing the stones as she went. You set your foot beside hers. The handrail is wet, but it holds.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.7.before",
|
"pageId": "campaign.7.before",
|
||||||
"resource": "narration_campaign_7_before",
|
"resource": "narration_campaign_7_before",
|
||||||
"text": "A rope hangs from a timber frame. The bell above it has fallen silent. Restore the pattern before you call out across the water.",
|
"text": "A rope hangs from a timber frame. The bell above it has fallen silent. Restore the pattern before you call out across the water.\n\nThis is the shore bell, within sight of the lighthouse when the weather is clear. Gran's note said to ring twice. You take up the slack in the rope before pulling; the first stroke will tell you whether the clapper is free. You hope she is listening.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "A rope hangs from a timber frame. The bell above it has fallen silent. Restore the pattern before you call out across the water.",
|
||||||
|
"continuation": "This is the shore bell, within sight of the lighthouse when the weather is clear. Gran's note said to ring twice. You take up the slack in the rope before pulling; the first stroke will tell you whether the clapper is free. You hope she is listening.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.7.after",
|
"pageId": "campaign.7.after",
|
||||||
"resource": "narration_campaign_7_after",
|
"resource": "narration_campaign_7_after",
|
||||||
"text": "One clear note travels into the fog. Two notes answer from the hill. Someone is waiting at the lighthouse.",
|
"text": "One clear note travels into the fog. Two notes answer from the hill. Someone is waiting at the lighthouse.\n\nYou give the two strokes she asked for. After a pause, the answering pair comes again from the smaller bell at the tower door. A lantern lifts in the window. You raise yours in return, and the last part of the climb no longer feels so lonely.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "One clear note travels into the fog. Two notes answer from the hill. Someone is waiting at the lighthouse.",
|
||||||
|
"continuation": "You give the two strokes she asked for. After a pause, the answering pair comes again from the smaller bell at the tower door. A lantern lifts in the window. You raise yours in return, and the last part of the climb no longer feels so lonely.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.8.before",
|
"pageId": "campaign.8.before",
|
||||||
"resource": "narration_campaign_8_before",
|
"resource": "narration_campaign_8_before",
|
||||||
"text": "Mara opens the lighthouse door. ‘I knew you’d find the notebook,’ she says. The storm stopped the turning mechanism. Together, you lay out its scattered parts.",
|
"text": "Mara opens the lighthouse door. ‘I knew you’d find the notebook,’ she says. The storm stopped the turning mechanism. Together, you lay out its scattered parts.\n\nHer hands are cold when she takes yours. 'You brought the old lantern,' she says, touching its mended handle. She tells you she came up before the tide covered the causeway. The tower is safe, but a loose gear stopped the lamp from turning. She could carry the supplies or the heavy toolbox, never both. You set the box between you.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "Mara opens the lighthouse door. ‘I knew you’d find the notebook,’ she says. The storm stopped the turning mechanism. Together, you lay out its scattered parts.",
|
||||||
|
"continuation": "Her hands are cold when she takes yours. 'You brought the old lantern,' she says, touching its mended handle. She tells you she came up before the tide covered the causeway. The tower is safe, but a loose gear stopped the lamp from turning. She could carry the supplies or the heavy toolbox, never both. You set the box between you.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.8.after",
|
"pageId": "campaign.8.after",
|
||||||
"resource": "narration_campaign_8_after",
|
"resource": "narration_campaign_8_after",
|
||||||
"text": "The missing gear slips into place. You turn the handle; the mechanism answers with a familiar, steady ticking. Mara smiles without looking up.",
|
"text": "The missing gear slips into place. You turn the handle; the mechanism answers with a familiar, steady ticking. Mara smiles without looking up.\n\n'Your grandfather used to listen for that sound from the stairs,' she says. For a while you both listen. The little ticking fills the room, quieter than the storm ever was. Then Gran gives you a cloth and points upstairs. There is still the glass to clean.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The missing gear slips into place. You turn the handle; the mechanism answers with a familiar, steady ticking. Mara smiles without looking up.",
|
||||||
|
"continuation": "'Your grandfather used to listen for that sound from the stairs,' she says. For a while you both listen. The little ticking fills the room, quieter than the storm ever was. Then Gran gives you a cloth and points upstairs. There is still the glass to clean.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.9.before",
|
"pageId": "campaign.9.before",
|
||||||
"resource": "narration_campaign_9_before",
|
"resource": "narration_campaign_9_before",
|
||||||
"text": "The great lens is clouded with salt. Mara holds the lantern while you work. The areas overlap like the rings in the glass; compare them carefully.",
|
"text": "The great lens is clouded with salt. Mara holds the lantern while you work. The areas overlap like the rings in the glass; compare them carefully.\n\nYou climb past the narrow windows with the oilskin over your arm. Gran follows slowly, carrying the lantern. At the top she pauses to catch her breath and lets you take the next bundle. You used to hurry to keep up with her on these stairs. Tonight you match your steps to hers.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The great lens is clouded with salt. Mara holds the lantern while you work. The areas overlap like the rings in the glass; compare them carefully.",
|
||||||
|
"continuation": "You climb past the narrow windows with the oilskin over your arm. Gran follows slowly, carrying the lantern. At the top she pauses to catch her breath and lets you take the next bundle. You used to hurry to keep up with her on these stairs. Tonight you match your steps to hers.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.9.after",
|
"pageId": "campaign.9.after",
|
||||||
"resource": "narration_campaign_9_after",
|
"resource": "narration_campaign_9_after",
|
||||||
"text": "You wipe the last salt from the lens. The lantern’s tiny flame stretches into a bright arc across the walls. Everything is ready.",
|
"text": "You wipe the last salt from the lens. The lantern’s tiny flame stretches into a bright arc across the walls. Everything is ready.\n\nThrough the cleared glass you can see the sheltered landing and the black thread of the stream. Gran checks the main lamp's oil feed while you put away the cloths. For the first time tonight, the whole route fits into one view. Every small thing you found has brought you here.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "You wipe the last salt from the lens. The lantern’s tiny flame stretches into a bright arc across the walls. Everything is ready.",
|
||||||
|
"continuation": "Through the cleared glass you can see the sheltered landing and the black thread of the stream. Gran checks the main lamp's oil feed while you put away the cloths. For the first time tonight, the whole route fits into one view. Every small thing you found has brought you here.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.10.before",
|
"pageId": "campaign.10.before",
|
||||||
"resource": "narration_campaign_10_before",
|
"resource": "narration_campaign_10_before",
|
||||||
"text": "Mara gives you the handle. Below the windows, the island lies dark. This is the pattern all the other pages were leading towards.",
|
"text": "Mara gives you the handle. Below the windows, the island lies dark. This is the pattern all the other pages were leading towards.\n\nThe lantern lights Gran's hands as she checks the wick of the great oil lamp. Its flame will stay here, beside the spare matches; the beacon has its own much larger burner. She lights it, checks the glass once more, and nods towards the turning handle. This time she stands beside you instead of doing it herself.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "Mara gives you the handle. Below the windows, the island lies dark. This is the pattern all the other pages were leading towards.",
|
||||||
|
"continuation": "The lantern lights Gran's hands as she checks the wick of the great oil lamp. Its flame will stay here, beside the spare matches; the beacon has its own much larger burner. She lights it, checks the glass once more, and nods towards the turning handle. This time she stands beside you instead of doing it herself.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.10.after",
|
"pageId": "campaign.10.after",
|
||||||
"resource": "narration_campaign_10_after",
|
"resource": "narration_campaign_10_after",
|
||||||
"text": "The beacon turns. Its light sweeps the harbour, the bridge, the little boat. Far offshore, a ship sounds its horn. The island has its light again.",
|
"text": "The beacon turns. Its light sweeps the harbour, the bridge, the little boat. Far offshore, a ship sounds its horn. The island has its light again.\n\nGran waits for the beam to return across the window. Only then does she let out her breath. 'There,' she says. No speech, no grand ceremony. She rests her hand over yours for one turn of the handle, and you feel the weight of the work she has done all these years.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "The beacon turns. Its light sweeps the harbour, the bridge, the little boat. Far offshore, a ship sounds its horn. The island has its light again.",
|
||||||
|
"continuation": "Gran waits for the beam to return across the window. Only then does she let out her breath. 'There,' she says. No speech, no grand ceremony. She rests her hand over yours for one turn of the handle, and you feel the weight of the work she has done all these years.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.11.before",
|
"pageId": "campaign.11.before",
|
||||||
"resource": "narration_campaign_11_before",
|
"resource": "narration_campaign_11_before",
|
||||||
"text": "Dawn finds you walking back with Mara. There is one blank page at the end of the notebook. ‘That one is yours,’ she says.",
|
"text": "Dawn finds you walking back with Mara. There is one blank page at the end of the notebook. ‘That one is yours,’ she says.\n\nYou leave the beacon running steadily. On the walk home, Gran names the things to mend tomorrow: a hinge, the store's gutter, that stubborn cottage latch. You add the loose floorboard. She says it has been loose for thirty years, but she hands you the key anyway.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "Dawn finds you walking back with Mara. There is one blank page at the end of the notebook. ‘That one is yours,’ she says.",
|
||||||
|
"continuation": "You leave the beacon running steadily. On the walk home, Gran names the things to mend tomorrow: a hinge, the store's gutter, that stubborn cottage latch. You add the loose floorboard. She says it has been loose for thirty years, but she hands you the key anyway.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pageId": "campaign.11.after",
|
"pageId": "campaign.11.after",
|
||||||
"resource": "narration_campaign_11_after",
|
"resource": "narration_campaign_11_after",
|
||||||
"text": "You light the cottage window. Mara puts the kettle on. Beneath your new drawing, you write: ‘No one comes home to an unlit shore.’ The notebook closes. Your watch has begun.",
|
"text": "You light the cottage window. Mara puts the kettle on. Beneath your new drawing, you write: ‘No one comes home to an unlit shore.’ The notebook closes. Your watch has begun.\n\nThe blue cup waits where she left it. While the kettle warms, you add tomorrow's tide time beneath your drawing. Gran reads it over your shoulder and nods. The notebook has room for repairs, crossings and ordinary evenings. You turn back once to the first small light, then leave a ribbon at the page you will need tomorrow.",
|
||||||
"speaker": "Narrator",
|
"speaker": "Narrator",
|
||||||
"voice": "bm_george",
|
"voice": "bm_george",
|
||||||
"speed": 0.88
|
"speed": 0.88,
|
||||||
|
"baseText": "You light the cottage window. Mara puts the kettle on. Beneath your new drawing, you write: ‘No one comes home to an unlit shore.’ The notebook closes. Your watch has begun.",
|
||||||
|
"continuation": "The blue cup waits where she left it. While the kettle warms, you add tomorrow's tide time beneath your drawing. Gran reads it over your shoulder and nods. The notebook has room for repairs, crossings and ordinary evenings. You turn back once to the first small light, then leave a ribbon at the page you will need tomorrow.",
|
||||||
|
"continuationSpeaker": "Narrator"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,7 +15,8 @@
|
|||||||
"speaker": "Mara",
|
"speaker": "Mara",
|
||||||
"campaignIndex": 0,
|
"campaignIndex": 0,
|
||||||
"textSource": "recording",
|
"textSource": "recording",
|
||||||
"illustrationAsset": "assets/artwork/cottage-vignette-v1.png"
|
"illustrationAsset": "assets/artwork/cottage-vignette-v1.png",
|
||||||
|
"continuation": "You find the message on the table, held flat by the blue cup. Gran wrote it before heading to the lighthouse with the first supplies. You have come across from the mainland to help after the storm; she has left this familiar room ready for your arrival. The notebook is her way of walking the island with you, even while she waits at the tower."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "cottage.match.puzzle",
|
"id": "cottage.match.puzzle",
|
||||||
@@ -29,7 +30,8 @@
|
|||||||
"type": "memory",
|
"type": "memory",
|
||||||
"speaker": "Mara",
|
"speaker": "Mara",
|
||||||
"campaignIndex": 0,
|
"campaignIndex": 0,
|
||||||
"textSource": "recording"
|
"textSource": "recording",
|
||||||
|
"continuation": "You cup the flame, just as she taught you. The smell of the match brings back wet mittens drying by this hearth and Gran counting the seconds between thunder and lightning. You have come to help her after the storm. For the first time since arriving, you know where to begin."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "cottage.folded.note",
|
"id": "cottage.folded.note",
|
||||||
|
|||||||
+42
-15
@@ -35,6 +35,7 @@ lib/
|
|||||||
│ └── game.dart Game (ChangeNotifier), Screen/Mode, puzzle session, awards
|
│ └── game.dart Game (ChangeNotifier), Screen/Mode, puzzle session, awards
|
||||||
├── services/
|
├── services/
|
||||||
│ ├── progress.dart Progress — typed façade over SharedPreferencesAsync
|
│ ├── progress.dart Progress — typed façade over SharedPreferencesAsync
|
||||||
|
│ ├── ambience.dart Ambience, Soundscape — location loops, fades and narration ducking
|
||||||
│ ├── narrator.dart Narrator — just_audio playback and passage cues
|
│ ├── narrator.dart Narrator — just_audio playback and passage cues
|
||||||
│ └── ads.dart Ads — UMP consent, rewarded hints, interstitials
|
│ └── ads.dart Ads — UMP consent, rewarded hints, interstitials
|
||||||
└── ui/
|
└── ui/
|
||||||
@@ -52,8 +53,8 @@ assets/
|
|||||||
├── artwork/*.png watercolours, vignettes and the notebook page
|
├── artwork/*.png watercolours, vignettes and the notebook page
|
||||||
└── fonts/DancingScript.ttf bundled as family MaraHand; OFL.txt ships with licences
|
└── fonts/DancingScript.ttf bundled as family MaraHand; OFL.txt ships with licences
|
||||||
|
|
||||||
test/puzzle_test.dart 11 domain tests (Java parity, generation, solver, awards, restore)
|
test/puzzle_test.dart domain tests (Java parity, generation, solver, awards, restore)
|
||||||
test/widget_test.dart 9 widget tests (page gestures, scrolling, landscape layout)
|
test/widget_test.dart widget tests (page gestures, scrolling, landscape layout)
|
||||||
test/fixtures/java_boards.json 40 reference boards from the Java 1.7 version
|
test/fixtures/java_boards.json 40 reference boards from the Java 1.7 version
|
||||||
integration_test/notebook_test.dart one on-device end-to-end test (QA flavour only)
|
integration_test/notebook_test.dart one on-device end-to-end test (QA flavour only)
|
||||||
scripts/ narration verification, install smoke check, narration rendering
|
scripts/ narration verification, install smoke check, narration rendering
|
||||||
@@ -65,7 +66,8 @@ scripts/ narration verification, install smoke check, narra
|
|||||||
flowchart TD
|
flowchart TD
|
||||||
subgraph UI["lib/ui — reusable page widgets"]
|
subgraph UI["lib/ui — reusable page widgets"]
|
||||||
paper["paper.dart<br/>Paper · Leaf · Cover · Sketch<br/>InkButton · PageSwipeBlocker"]
|
paper["paper.dart<br/>Paper · Leaf · Cover · Sketch<br/>InkButton · PageSwipeBlocker"]
|
||||||
board["board.dart<br/>Board · PencilMark · PixelPicture"]
|
board["board.dart<br/>Board · PencilMark · PixelPicture · PatternStamp"]
|
||||||
|
discovery["discovery.dart<br/>Discovery · transition · replay"]
|
||||||
end
|
end
|
||||||
main["main.dart<br/>LumenApp · Notebook<br/>six screen builders · dialogs"]
|
main["main.dart<br/>LumenApp · Notebook<br/>six screen builders · dialogs"]
|
||||||
game["domain/game.dart<br/>Game (ChangeNotifier)<br/>Screen/Mode · session · awards"]
|
game["domain/game.dart<br/>Game (ChangeNotifier)<br/>Screen/Mode · session · awards"]
|
||||||
@@ -73,12 +75,17 @@ flowchart TD
|
|||||||
book["domain/book.dart<br/>Book · CampaignLevel · StoryPage"]
|
book["domain/book.dart<br/>Book · CampaignLevel · StoryPage"]
|
||||||
progress["services/progress.dart<br/>Progress — local key/value store"]
|
progress["services/progress.dart<br/>Progress — local key/value store"]
|
||||||
narrator["services/narrator.dart<br/>Narrator — just_audio"]
|
narrator["services/narrator.dart<br/>Narrator — just_audio"]
|
||||||
|
ambience["services/ambience.dart<br/>Ambience · Soundscape — just_audio"]
|
||||||
ads["services/ads.dart<br/>Ads — UMP consent + AdMob"]
|
ads["services/ads.dart<br/>Ads — UMP consent + AdMob"]
|
||||||
|
|
||||||
main --> paper
|
main --> paper
|
||||||
main --> board
|
main --> board
|
||||||
|
main --> discovery
|
||||||
|
discovery --> board
|
||||||
|
discovery --> paper
|
||||||
main --> game
|
main --> game
|
||||||
main --> narrator
|
main --> narrator
|
||||||
|
main --> ambience
|
||||||
main --> ads
|
main --> ads
|
||||||
board --> puzzle
|
board --> puzzle
|
||||||
board --> paper
|
board --> paper
|
||||||
@@ -91,6 +98,7 @@ flowchart TD
|
|||||||
book --> scripts[("assets/narration/scripts.json")]
|
book --> scripts[("assets/narration/scripts.json")]
|
||||||
narrator --> manifest[("assets/audio/narration_manifest.json")]
|
narrator --> manifest[("assets/audio/narration_manifest.json")]
|
||||||
narrator --> wav[("assets/audio/*.wav")]
|
narrator --> wav[("assets/audio/*.wav")]
|
||||||
|
ambience --> wav
|
||||||
```
|
```
|
||||||
|
|
||||||
Dependency rules:
|
Dependency rules:
|
||||||
@@ -146,7 +154,8 @@ stateDiagram-v2
|
|||||||
game --> briefing: swipe back
|
game --> briefing: swipe back
|
||||||
game --> contents: Back to notebook
|
game --> contents: Back to notebook
|
||||||
game --> home: daily or classic back
|
game --> home: daily or classic back
|
||||||
reveal --> briefing: next or previous leaf
|
reveal --> briefing: next leaf
|
||||||
|
reveal --> game: previous leaf / Android back / inspect solved pattern
|
||||||
reveal --> contents: last page or Back
|
reveal --> contents: last page or Back
|
||||||
reveal --> game: Today's puzzle
|
reveal --> game: Today's puzzle
|
||||||
game --> game: daily or classic solve
|
game --> game: daily or classic solve
|
||||||
@@ -159,7 +168,7 @@ stateDiagram-v2
|
|||||||
| `contents` | `contents()` | `contents-<chapter>` | Four chapter entries, ribbon bookmark, reading resume and optional cottage scraps; chapter navigation | none |
|
| `contents` | `contents()` | `contents-<chapter>` | Four chapter entries, ribbon bookmark, reading resume and optional cottage scraps; chapter navigation | none |
|
||||||
| `briefing` | `briefing()` | `briefing-<i>` | Chapter, title, `before` passage, "Restore the pattern →" | `turnCampaign()` |
|
| `briefing` | `briefing()` | `briefing-<i>` | Chapter, title, `before` passage, "Restore the pattern →" | `turnCampaign()` |
|
||||||
| `game` | `game()` | `game-<key>` | Puzzle heading, area totals, square board, hint/undo, actions | `turnCampaign()` in campaign mode only |
|
| `game` | `game()` | `game-<key>` | Puzzle heading, area totals, square board, hint/undo, actions | `turnCampaign()` in campaign mode only |
|
||||||
| `reveal` | `reveal()` | `reveal-<i>` | Object name, watercolour (or `PixelPicture` fallback), `after` passage, ending text on level 12 | `turnCampaign()` |
|
| `reveal` | `reveal()` | `reveal-<i>` | Object name, pattern-to-watercolour transition and permanent symbol (or `PixelPicture` fallback), `after` passage plus continuation, ending text on level 12 | `turnCampaign()` |
|
||||||
|
|
||||||
### Navigation methods (`Game`)
|
### Navigation methods (`Game`)
|
||||||
|
|
||||||
@@ -172,7 +181,7 @@ stateDiagram-v2
|
|||||||
| `leaveCottage()` | Open Chapter II for reading without awarding unfinished cottage puzzles |
|
| `leaveCottage()` | Open Chapter II for reading without awarding unfinished cottage puzzles |
|
||||||
| `briefing(i)` | Clamp to `accessible`; cottage entry leaf or later `Screen.briefing` |
|
| `briefing(i)` | Clamp to `accessible`; cottage entry leaf or later `Screen.briefing` |
|
||||||
| `reveal(i, {readAhead})` | Redirect to `briefing(i)` unless recovered, or read-ahead is allowed for an accessible level; otherwise the cottage memory leaf or later `Screen.reveal` |
|
| `reveal(i, {readAhead})` | Redirect to `briefing(i)` unless recovered, or read-ahead is allowed for an accessible level; otherwise the cottage memory leaf or later `Screen.reveal` |
|
||||||
| `startCampaign(i)` | No-op if `i > accessible`; recovered levels go to `reveal`; else load `book.levels[i]` under `story_v1_<i>` and open the cottage puzzle leaf or later `Screen.game` |
|
| `startCampaign(i)` | No-op if `i > accessible`; including recovered levels, load `book.levels[i]` under `story_v1_<i>` and open the cottage puzzle leaf or later `Screen.game` |
|
||||||
| `startDaily(day)` | Load `Puzzle.seeded(epochDay(date) * 7919)` under `d<YYYY-MM-DD>`; `Screen.game` |
|
| `startDaily(day)` | Load `Puzzle.seeded(epochDay(date) * 7919)` under `d<YYYY-MM-DD>`; `Screen.game` |
|
||||||
| `startPractice([level])` | Generate 5×5 board off the UI isolate with `compute(generatePractice)`; key `v2_<DIFFICULTY>_<level>`; `Screen.game` |
|
| `startPractice([level])` | Generate 5×5 board off the UI isolate with `compute(generatePractice)`; key `v2_<DIFFICULTY>_<level>`; `Screen.game` |
|
||||||
| `mark(i)` / `undo()` / `area(i)` | Cycle a cell 0→1→2→0, restore the previous snapshot, select an A/B/C area |
|
| `mark(i)` / `undo()` / `area(i)` | Cycle a cell 0→1→2→0, restore the previous snapshot, select an A/B/C area |
|
||||||
@@ -239,7 +248,8 @@ Content pipelines:
|
|||||||
- `Board(puzzle, cells, onMark, selectedArea, won, maxWidth)` renders a square grid with row/column clues, fixed-clue dots, region highlight and per-cell `ValueKey('cell-<i>')`.
|
- `Board(puzzle, cells, onMark, selectedArea, won, maxWidth)` renders a square grid with row/column clues, fixed-clue dots, region highlight and per-cell `ValueKey('cell-<i>')`.
|
||||||
- `maxWidth` defaults to 350 (portrait). On wide leaves it is passed the available square; the clue unit is `u = boardWidth / (size + 1.3)` and clue text is clamped to 16–23 px.
|
- `maxWidth` defaults to 350 (portrait). On wide leaves it is passed the available square; the clue unit is `u = boardWidth / (size + 1.3)` and clue text is clamped to 16–23 px.
|
||||||
- Each cell has a semantic label such as `Row 3, column 5, lit, fixed clue`; the whole board is wrapped in `PageSwipeBlocker`.
|
- Each cell has a semantic label such as `Row 3, column 5, lit, fixed clue`; the whole board is wrapped in `PageSwipeBlocker`.
|
||||||
- `PixelPicture` shows the recovered 7×7 object after a campaign solve.
|
- `PixelPicture` shows the recovered 7×7 object when artwork is unavailable. `PatternStamp` draws the exact same 49 solution cells without a frame.
|
||||||
|
- `Discovery` (`ui/discovery.dart`) holds the solution briefly, then crossfades into the watercolour over 2.8 seconds. A small permanent stamp links the art to the solved symbol; an ink button replays the transition. Reduced-motion settings show the finished illustration and stamp immediately. Recovered grids are read-only and reconstructed from the solution if an old completed save lacks marks.
|
||||||
|
|
||||||
### Portrait versus landscape composition
|
### Portrait versus landscape composition
|
||||||
|
|
||||||
@@ -286,12 +296,14 @@ All writes go through `Progress.set` (memory is updated synchronously, disk is w
|
|||||||
| `grid_<key>` | digit string | `Game._save` | Marks per board (`0` empty, `1` lit, `2` crossed) |
|
| `grid_<key>` | digit string | `Game._save` | Marks per board (`0` empty, `1` lit, `2` crossed) |
|
||||||
| `done_<key>` | bool | `Game.check` | Exactly-once completion and win lock |
|
| `done_<key>` | bool | `Game.check` | Exactly-once completion and win lock |
|
||||||
| `solved` | int | `Game.check` | Lifetime completions |
|
| `solved` | int | `Game.check` | Lifetime completions |
|
||||||
| `hint_<key>` | bool | `hint()` | First explained hint is free; later ones need a rewarded ad |
|
| `hint_<key>` | bool | `hint()` | Tracks hint use; daily/classic later hints need a rewarded ad, campaign hints stay free |
|
||||||
| `lastDaily` | int (epoch day) | daily completion | Streak bookkeeping |
|
| `lastDaily` | int (epoch day) | daily completion | Streak bookkeeping |
|
||||||
| `streak` | int | daily completion | Consecutive daily completions |
|
| `streak` | int | daily completion | Consecutive daily completions |
|
||||||
| `campaignUnlocked` | int 0–11 | campaign completion | Furthest solved campaign level |
|
| `campaignUnlocked` | int 0–11 | campaign completion | Furthest solved campaign level |
|
||||||
| `story_access_level` | int 0–11 | `nextCampaign`, `leaveCottage` | Furthest readable campaign level; effective access is at least 3 for cottage exploration, independent of awards |
|
| `story_access_level` | int 0–11 | `nextCampaign`, `leaveCottage` | Furthest readable campaign level; effective access is at least 3 for cottage exploration, independent of awards |
|
||||||
| `storyAd_<index>` | bool | `nextCampaign` | At most one interstitial per fourth campaign step |
|
| `storyAd_<index>` | bool | `nextCampaign` | At most one interstitial per fourth campaign step |
|
||||||
|
| `ambience_enabled` | bool (default true) | Sound & atmosphere | Independent environmental audio switch, applies only within story pages |
|
||||||
|
| `ambience_volume` | double 0–1 (default 0.7) | Sound & atmosphere | Saved environmental volume, independent of narration speed |
|
||||||
| `recording_speed` | double | speed dialog | `0.85`, `1.0` or `1.15` |
|
| `recording_speed` | double | speed dialog | `0.85`, `1.0` or `1.15` |
|
||||||
|
|
||||||
Board key formats (`<key>`):
|
Board key formats (`<key>`):
|
||||||
@@ -302,14 +314,17 @@ Board key formats (`<key>`):
|
|||||||
|
|
||||||
## Content and assets
|
## Content and assets
|
||||||
|
|
||||||
- `assets/campaign.json`: `{ premise, levels: [{ chapter, title, object, before, after, picture, clues, areas, illustrationAsset? }] }`. `picture` is 49 characters of `0`/`1` (7×7, row-major). `clues` is a comma-separated list of forced-given indices. `areas` is `top,left,height,width` rectangles separated by `;` (labels A, B, C… in order).
|
- `assets/campaign.json`: `{ premise, levels: [{ chapter, title, object, before, after, picture, clues, areas, illustrationAsset?, beforeContinuation?, afterContinuation? }] }`. `picture` is 49 characters of `0`/`1` (7×7, row-major). `clues` is a comma-separated list of forced-given indices. `areas` is `top,left,height,width` rectangles separated by `;` (labels A, B, C… in order).
|
||||||
- `assets/notebook.json`: sixteen ordered records with stable `id`, `type`, `title`, optional `campaignIndex`, `speaker`, `illustrationAsset` and `textSource` (`recording`, `before`, `after`) or inline `text`. `Book.pageFor()` finds a campaign entry/puzzle/memory. Preserve the first six IDs when extending the chapter.
|
- `assets/notebook.json`: sixteen ordered records with stable `id`, `type`, `title`, optional `campaignIndex`, `speaker`, `illustrationAsset` and `textSource` (`recording`, `before`, `after`) or inline `text`, plus optional `continuation`. `Book.pageFor()` finds a campaign entry/puzzle/memory. Preserve the first six IDs when extending the chapter.
|
||||||
|
- Campaign `beforeContinuation`/`afterContinuation` add narrative after the original passage, with one audio control after the full text. Cottage entries/memories inherit these by text source; custom recording leaves can supply their own `continuation`. Recorded scripts include both parts. Recording-source leaves read `baseText` for the original displayed passage. Every new continuation has narrator cues; the original take remains byte-identical as PCM and has its own prefix checksum in the manifest.
|
||||||
|
- Campaign balance: all area puzzles have at least seven initial single-clue deductions; solver comparison counts are capped at 3 for the key, 5 for the crossing chapter and 6 for the final chapter. These are regression bounds, not a substitute for player feedback. Every area puzzle still needs comparison and has a unique, no-guess solution.
|
||||||
- Cottage `briefing`, `startCampaign` and `reveal` route to the entry, puzzle or memory leaf for levels 0–3. This migrates older saved routes while retaining marks, hint keys and completion awards. Chapters II/III use the existing screens.
|
- Cottage `briefing`, `startCampaign` and `reveal` route to the entry, puzzle or memory leaf for levels 0–3. This migrates older saved routes while retaining marks, hint keys and completion awards. Chapters II/III use the existing screens.
|
||||||
- `assets/narration/scripts.json`: canonical diary text, one record per recorded page (`pageId`, `text`). `Book.load()` resolves `recording` text by stable page ID; a missing script yields empty text.
|
- `assets/narration/scripts.json`: canonical complete diary text, one record per recorded page (`pageId`, `text`, optional `baseText`, `continuation`, `continuationSpeaker`). `Book.load()` resolves `recording` base text by stable page ID; a missing script yields empty text.
|
||||||
- `assets/narration/manifest.json`: source masters, text hashes, WAV/FLAC hashes and cues — the provenance record.
|
- `assets/narration/manifest.json`: source masters, text hashes, WAV/FLAC hashes and cues — the provenance record.
|
||||||
- `assets/audio/narration_manifest.json`: runtime `{ tracks: { pageId: { file, durationMs, cues: [{ startMs, endMs, text }] } } }`. `Narrator` plays `assets/audio/<file>`.
|
- `assets/audio/narration_manifest.json`: runtime `{ tracks: { pageId: { file, durationMs, cues: [{ startMs, endMs, text }] } } }`. `Narrator` plays `assets/audio/<file>`.
|
||||||
- Five Mara recordings exist: `cottage.dedication`, `cottage.window`, `cottage.match.memory`, `cottage.folded.note`, `cottage.lantern.sketch`. The match-puzzle leaf has no recording.
|
- Five Mara recordings exist: `cottage.dedication`, `cottage.window`, `cottage.match.memory`, `cottage.folded.note`, `cottage.lantern.sketch`. The match-puzzle leaf has no recording.
|
||||||
- Twenty-three narrator tracks use `bm_george`: seven cottage prose leaves and `campaign.<4..11>.before/after`. `scripts.json` records speaker/voice/speed; the renderer accepts `--speaker Narrator` to preserve Mara’s original takes. The asset checker validates narrator scripts against notebook/campaign text.
|
- Twenty-three narrator tracks use `bm_george`: seven cottage prose leaves and `campaign.<4..11>.before/after`. `scripts.json` records speaker/voice/speed; the renderer accepts `--speaker Narrator` to preserve Mara’s original takes. `--append-continuations` appends only the narrator additions to existing PCM masters and records the original PCM frame count and checksum; use it when adding to existing recordings. The asset checker validates narrator scripts against notebook/campaign text.
|
||||||
|
- `audio()` follows the current cue speaker, including the switch from Mara to the narrator on the window/match memory pages. Both original and continuation paragraphs use cue highlighting.
|
||||||
- `audio()` uses the story ID or `campaign.<index>.before/after`, with a visible speaker label. Never show a recording control for an ID without a bundled track.
|
- `audio()` uses the story ID or `campaign.<index>.before/after`, with a visible speaker label. Never show a recording control for an ID without a bundled track.
|
||||||
- `discoveryArt()` returns only a text placeholder until `Game.recovered(index)` is true. This gates both watercolours and pixel fallbacks; entry, inspection and closing leaves never call it, regardless of completed progress. The helper also rejects calls outside a memory/reveal screen. The repair note uses a text action rather than a picture hotspot; completed saves must not re-enable artwork on earlier leaves. Contextual cottage/background art is separate from the discovery images.
|
- `discoveryArt()` returns only a text placeholder until `Game.recovered(index)` is true. This gates both watercolours and pixel fallbacks; entry, inspection and closing leaves never call it, regardless of completed progress. The helper also rejects calls outside a memory/reveal screen. The repair note uses a text action rather than a picture hotspot; completed saves must not re-enable artwork on earlier leaves. Contextual cottage/background art is separate from the discovery images.
|
||||||
- The `check` Android flavor (`com.lumen.daily.check`) isolates device automation from the user’s installed QA app and progress.
|
- The `check` Android flavor (`com.lumen.daily.check`) isolates device automation from the user’s installed QA app and progress.
|
||||||
@@ -327,11 +342,19 @@ Board key formats (`<key>`):
|
|||||||
- Narration stops on route change and when the app backgrounds; the player is disposed with `Notebook`.
|
- Narration stops on route change and when the app backgrounds; the player is disposed with `Notebook`.
|
||||||
- Playback failures surface as reader-friendly text and never block reading.
|
- Playback failures surface as reader-friendly text and never block reading.
|
||||||
|
|
||||||
|
### Environmental audio
|
||||||
|
|
||||||
|
- `Ambience` owns a separate looping player. `soundscapeFor(index)` maps cottage/home to cottage air, boat/anchor/bell to harbour water, bridge to flowing water and tower discoveries to wind. Home, contents, daily and practice screens are silent.
|
||||||
|
- `_syncAtmosphere()` follows navigation, narration and app lifecycle. Story ambience defaults on and resumes on foregrounding; narration stays opt-in. Muting/backgrounding stops it; scene transitions and volume changes fade over 240 ms.
|
||||||
|
- Environmental gain is `0.4 × saved volume`, reduced to one quarter while narration plays or loads. Both players share the speech audio session; the environmental player disables automatic session activation to avoid competing with narration. Audio interruptions/headphone removal use just_audio interruption handling.
|
||||||
|
- A serial queue and revision guard discard stale requests while loading/fading. Missing soundscapes never block narration or puzzles. `AmbienceOutput` allows race, fade, failure and lifecycle tests without a device backend.
|
||||||
|
- `scripts/render_ambience.py` deterministically renders four original 24-second PCM16/24 kHz loops offline. `assets/audio/ambience_manifest.json` records seeds/checksums. `scripts/check_soundscape_assets.py` checks bundling, PCM format, levels and loop boundaries.
|
||||||
|
|
||||||
### Ads and consent flow
|
### Ads and consent flow
|
||||||
|
|
||||||
- `Ads.supported` is false on the web, when `enabled`/`adsEnabled` is false (both test suites pass `adsEnabled: false`) and on platforms other than Android/iOS.
|
- `Ads.supported` is false on the web, when `enabled`/`adsEnabled` is false (both test suites pass `adsEnabled: false`) and on platforms other than Android/iOS.
|
||||||
- `start()` requests UMP consent, shows the form if required, then initialises the SDK and preloads one rewarded and one interstitial ad.
|
- `start()` requests UMP consent, shows the form if required, then initialises the SDK and preloads one rewarded and one interstitial ad.
|
||||||
- Hint flow: the first hint per board is free (`hint_<key>`), later hints require confirmation and `ads.hint(give)`. If no ad is available the user sees "No ad available. Please try again later." and no hint is consumed.
|
- Hint flow: campaign hints are always free and explained. Daily/classic boards keep the first-free policy (`hint_<key>`); later hints require confirmation and `ads.hint(give)`. If no ad is available the user sees "No ad available. Please try again later." and no hint is consumed.
|
||||||
- Interstitials: `nextPractice()` after every fourth classic completion; `nextCampaign()` at most once per fourth campaign step (`storyAd_<index>`). `between(next)` always calls `next()` if ads are unavailable, stale (≥58 min) or unconsented.
|
- Interstitials: `nextPractice()` after every fourth classic completion; `nextCampaign()` at most once per fourth campaign step (`storyAd_<index>`). `between(next)` always calls `next()` if ads are unavailable, stale (≥58 min) or unconsented.
|
||||||
- `privacy()` opens the privacy options form only when UMP requires it; otherwise `main.dart` shows the local privacy explanation.
|
- `privacy()` opens the privacy options form only when UMP requires it; otherwise `main.dart` shows the local privacy explanation.
|
||||||
- Ad unit IDs default to Google test IDs; production overrides come from `ADMOB_APP_ID` (Gradle), `ADMOB_REWARDED_ID` and `ADMOB_INTERSTITIAL_ID` (Dart defines).
|
- Ad unit IDs default to Google test IDs; production overrides come from `ADMOB_APP_ID` (Gradle), `ADMOB_REWARDED_ID` and `ADMOB_INTERSTITIAL_ID` (Dart defines).
|
||||||
@@ -340,8 +363,10 @@ Board key formats (`<key>`):
|
|||||||
|
|
||||||
| File | Covers |
|
| File | Covers |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
|
| `test/ambience_test.dart` | Scene mapping, voice ducking, mute/background stop, stale loading requests, backend failure/recovery and disposal |
|
||||||
|
| `integration_test/soundscape_test.dart` | Real-device decoding of all 24 new continuations, bridge/narration mixing, saved mute and automatic Mara-to-narrator handoff |
|
||||||
| `test/puzzle_test.dart` | 40 Java reference boards (signed 64-bit seeds), 300 graded boards, solver counts vs. exhaustive search, campaign uniqueness/no-guess, streaks, fresh progress, read-ahead, daily awards and practice levels |
|
| `test/puzzle_test.dart` | 40 Java reference boards (signed 64-bit seeds), 300 graded boards, solver counts vs. exhaustive search, campaign uniqueness/no-guess, streaks, fresh progress, read-ahead, daily awards and practice levels |
|
||||||
| `test/widget_test.dart` | Page swipes vs. grid drags, swipes over text/blank paper, vertical scrolling and cancelled drags, small/landscape/1.5× text, landscape two-column puzzle leaf, illustrated campaign reveals and pixel fallback at 1.5× text |
|
| `test/widget_test.dart` | Pattern-to-art timing/replay, back-to-solved-grid navigation, repeated free story hints, page swipes vs. grid drags, swipes over text/blank paper, vertical scrolling and cancelled drags, small/landscape/1.5× text, landscape two-column puzzle leaf, illustrated campaign reveals and pixel fallback at 1.5× text |
|
||||||
| `integration_test/notebook_test.dart` | On-device QA flow: six leaves, real WAV playback and pause/resume, bookmarks/discoveries, match and lantern solves, exactly-once awards, QA disk round-trip, screenshots |
|
| `integration_test/notebook_test.dart` | On-device QA flow: six leaves, real WAV playback and pause/resume, bookmarks/discoveries, match and lantern solves, exactly-once awards, QA disk round-trip, screenshots |
|
||||||
| `integration_test/cottage_test.dart` | All sixteen leaves, larger-text portrait/landscape, bookmarks, legacy-key marks, all four awards, all 23 narrator tracks and isolated test persistence; eight screenshots |
|
| `integration_test/cottage_test.dart` | All sixteen leaves, larger-text portrait/landscape, bookmarks, legacy-key marks, all four awards, all 23 narrator tracks and isolated test persistence; eight screenshots |
|
||||||
| `integration_test/discovery_art_test.dart` | QA tablet screenshots of all twelve discoveries and the opening match memory, portrait/landscape at 1.5× text; checks reachable controls and unchanged awards |
|
| `integration_test/discovery_art_test.dart` | QA tablet screenshots of all twelve discoveries and the opening match memory, portrait/landscape at 1.5× text; checks reachable controls and unchanged awards |
|
||||||
@@ -356,6 +381,7 @@ flutter pub get
|
|||||||
flutter analyze
|
flutter analyze
|
||||||
flutter test
|
flutter test
|
||||||
python3 scripts/check_narration_assets.py
|
python3 scripts/check_narration_assets.py
|
||||||
|
python3 scripts/check_soundscape_assets.py
|
||||||
|
|
||||||
# QA APK for isolated on-device checks (package com.lumen.daily.qa)
|
# QA APK for isolated on-device checks (package com.lumen.daily.qa)
|
||||||
flutter build apk --debug --flavor qa
|
flutter build apk --debug --flavor qa
|
||||||
@@ -455,7 +481,8 @@ grep -rn "ValueKey('cell-\|leaf-scroll\|leaf-side-scroll" lib test
|
|||||||
|
|
||||||
- Keep it in step with the root `README.md` (user-facing overview) and `ROADMAP.md` (product direction). This file is the only architecture/dependency map.
|
- Keep it in step with the root `README.md` (user-facing overview) and `ROADMAP.md` (product direction). This file is the only architecture/dependency map.
|
||||||
- Update the Mermaid graph when imports between layers change, when a screen is added, or when persistence keys or invariants change.
|
- Update the Mermaid graph when imports between layers change, when a screen is added, or when persistence keys or invariants change.
|
||||||
- Re-run `flutter analyze`, `flutter test` and `python3 scripts/check_narration_assets.py` after structural edits.
|
- Re-run `flutter analyze`, `flutter test` and `python3 scripts/check_narration_assets.py
|
||||||
|
python3 scripts/check_soundscape_assets.py` after structural edits.
|
||||||
- The map is hand-maintained; no generator or CI check keeps it current, so treat drift as a bug.
|
- The map is hand-maintained; no generator or CI check keeps it current, so treat drift as a bug.
|
||||||
|
|
||||||
_Last reviewed against version 2.0.2+11._
|
_Last reviewed against version 2.0.2+11._
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:audio_session/audio_session.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:integration_test/integration_test.dart';
|
||||||
|
import 'package:just_audio/just_audio.dart';
|
||||||
|
import 'package:lumen/domain/book.dart';
|
||||||
|
import 'package:lumen/domain/game.dart';
|
||||||
|
import 'package:lumen/main.dart';
|
||||||
|
import 'package:lumen/services/progress.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
testWidgets('extended readings decode and mix with bridge atmosphere', (
|
||||||
|
tester,
|
||||||
|
) async {
|
||||||
|
expect(const bool.fromEnvironment('QA_TEST'), true);
|
||||||
|
final book = await Book.load();
|
||||||
|
final session = await AudioSession.instance;
|
||||||
|
await session.configure(const AudioSessionConfiguration.speech());
|
||||||
|
final probe = AudioPlayer();
|
||||||
|
// Exercise the newly added audio, beyond the old recording's endpoint.
|
||||||
|
for (final track in book.tracks.values.where(
|
||||||
|
(t) => t['continuation'] != null,
|
||||||
|
)) {
|
||||||
|
await probe.setAsset('assets/audio/${track['file']}');
|
||||||
|
expect(probe.duration!.inMilliseconds, closeTo(track['durationMs'], 5));
|
||||||
|
final start = Duration(milliseconds: track['cues'].last['startMs']);
|
||||||
|
await probe.seek(start);
|
||||||
|
await probe.setVolume(.3);
|
||||||
|
unawaited(probe.play());
|
||||||
|
await Future<void>.delayed(const Duration(milliseconds: 350));
|
||||||
|
expect(probe.position, greaterThanOrEqualTo(start));
|
||||||
|
expect(probe.processingState, ProcessingState.ready);
|
||||||
|
await probe.stop();
|
||||||
|
}
|
||||||
|
await probe.dispose();
|
||||||
|
final g = Game(book, Progress.memory({'story_access_level': 11}));
|
||||||
|
g.briefing(6);
|
||||||
|
await tester.pumpWidget(LumenApp(game: g, adsEnabled: false));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.ensureVisible(find.text('Play this reading'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.tap(find.text('Play this reading'));
|
||||||
|
await Future<void>.delayed(const Duration(seconds: 2));
|
||||||
|
await tester.pump();
|
||||||
|
expect(find.text('Pause recording'), findsOneWidget);
|
||||||
|
// The host captures AudioFlinger during this interval to verify two real tracks.
|
||||||
|
debugPrint('MIXED_AUDIO_READY: bridge water and narration');
|
||||||
|
await Future<void>.delayed(const Duration(seconds: 12));
|
||||||
|
await tester.tap(find.text('Pause recording'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(find.text('Resume recording'), findsOneWidget);
|
||||||
|
await tester.tap(find.text('Sound & atmosphere'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.tap(find.byType(SwitchListTile));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(g.progress.flag('ambience_enabled'), false);
|
||||||
|
await tester.tap(find.text('Keep going'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.tap(find.text('Stop'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
// A single Play control carries Mara's unchanged diary into the narrator's
|
||||||
|
// new continuation and updates the speaker label at the voice boundary.
|
||||||
|
g.showStory(1);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.ensureVisible(find.text('Play this reading'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.tap(find.text('Play this reading'));
|
||||||
|
final originalMs =
|
||||||
|
(book.tracks['cottage.window']['originalFrames'] as int) *
|
||||||
|
1000 ~/
|
||||||
|
24000;
|
||||||
|
await Future<void>.delayed(Duration(milliseconds: originalMs + 1800));
|
||||||
|
await tester.pump();
|
||||||
|
expect(find.text('Narrator · recorded story'), findsOneWidget);
|
||||||
|
await tester.tap(find.text('Pause recording'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(tester.takeException(), isNull);
|
||||||
|
await binding.convertFlutterSurfaceToImage();
|
||||||
|
await tester.pump();
|
||||||
|
await binding.takeScreenshot('expanded-narration-continuation');
|
||||||
|
await tester.pumpWidget(const SizedBox());
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
});
|
||||||
|
}
|
||||||
+13
-1
@@ -11,11 +11,14 @@ class CampaignLevel {
|
|||||||
object = data['object'],
|
object = data['object'],
|
||||||
before = data['before'],
|
before = data['before'],
|
||||||
after = data['after'],
|
after = data['after'],
|
||||||
|
beforeContinuation = data['beforeContinuation'] as String? ?? '',
|
||||||
|
afterContinuation = data['afterContinuation'] as String? ?? '',
|
||||||
illustrationAsset = data['illustrationAsset'] as String?,
|
illustrationAsset = data['illustrationAsset'] as String?,
|
||||||
picture = (data['picture'] as String).split('').map(int.parse).toList(),
|
picture = (data['picture'] as String).split('').map(int.parse).toList(),
|
||||||
clues = data['clues'],
|
clues = data['clues'],
|
||||||
areas = data['areas'];
|
areas = data['areas'];
|
||||||
final String chapter, title, object, before, after, clues, areas;
|
final String chapter, title, object, before, after, clues, areas;
|
||||||
|
final String beforeContinuation, afterContinuation;
|
||||||
final String? illustrationAsset;
|
final String? illustrationAsset;
|
||||||
final List<int> picture;
|
final List<int> picture;
|
||||||
Puzzle puzzle() {
|
Puzzle puzzle() {
|
||||||
@@ -57,8 +60,10 @@ class StoryPage {
|
|||||||
this.campaignIndex,
|
this.campaignIndex,
|
||||||
this.speaker = '',
|
this.speaker = '',
|
||||||
this.illustrationAsset,
|
this.illustrationAsset,
|
||||||
|
this.continuation = '',
|
||||||
});
|
});
|
||||||
final String id, title, text;
|
final String id, title, text;
|
||||||
|
final String continuation;
|
||||||
final StoryPageType type;
|
final StoryPageType type;
|
||||||
final int? campaignIndex;
|
final int? campaignIndex;
|
||||||
final String speaker;
|
final String speaker;
|
||||||
@@ -105,7 +110,7 @@ class Book {
|
|||||||
'recording' =>
|
'recording' =>
|
||||||
scripts
|
scripts
|
||||||
.where((s) => s['pageId'] == record['id'])
|
.where((s) => s['pageId'] == record['id'])
|
||||||
.map((s) => s['text'] as String)
|
.map((s) => (s['baseText'] ?? s['text']) as String)
|
||||||
.firstOrNull ??
|
.firstOrNull ??
|
||||||
'',
|
'',
|
||||||
_ => record['text'] as String? ?? '',
|
_ => record['text'] as String? ?? '',
|
||||||
@@ -118,6 +123,13 @@ class Book {
|
|||||||
campaignIndex: index,
|
campaignIndex: index,
|
||||||
speaker: record['speaker'] as String? ?? '',
|
speaker: record['speaker'] as String? ?? '',
|
||||||
illustrationAsset: record['illustrationAsset'] as String?,
|
illustrationAsset: record['illustrationAsset'] as String?,
|
||||||
|
continuation:
|
||||||
|
record['continuation'] as String? ??
|
||||||
|
switch (record['textSource']) {
|
||||||
|
'before' => levels[index!].beforeContinuation,
|
||||||
|
'after' => levels[index!].afterContinuation,
|
||||||
|
_ => '',
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
tracks,
|
tracks,
|
||||||
|
|||||||
@@ -201,10 +201,6 @@ class Game extends ChangeNotifier {
|
|||||||
_request++;
|
_request++;
|
||||||
busy = false;
|
busy = false;
|
||||||
if (i > accessible) return;
|
if (i > accessible) return;
|
||||||
if (recovered(i)) {
|
|
||||||
reveal(i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
campaignIndex = i;
|
campaignIndex = i;
|
||||||
mode = Mode.campaign;
|
mode = Mode.campaign;
|
||||||
if (i < 4) {
|
if (i < 4) {
|
||||||
@@ -220,6 +216,7 @@ class Game extends ChangeNotifier {
|
|||||||
key = id;
|
key = id;
|
||||||
final saved = progress.text('grid_$id');
|
final saved = progress.text('grid_$id');
|
||||||
cells = List.generate(p.solution.length, (i) {
|
cells = List.generate(p.solution.length, (i) {
|
||||||
|
if (progress.flag('done_$id')) return p.solution[i] == 1 ? 1 : 2;
|
||||||
if (p.given[i]) return p.solution[i] == 1 ? 1 : 2;
|
if (p.given[i]) return p.solution[i] == 1 ? 1 : 2;
|
||||||
final value = saved.length == p.solution.length
|
final value = saved.length == p.solution.length
|
||||||
? int.tryParse(saved[i]) ?? 0
|
? int.tryParse(saved[i]) ?? 0
|
||||||
|
|||||||
+136
-13
@@ -10,9 +10,11 @@ import 'domain/book.dart';
|
|||||||
import 'domain/game.dart';
|
import 'domain/game.dart';
|
||||||
import 'domain/puzzle.dart';
|
import 'domain/puzzle.dart';
|
||||||
import 'services/ads.dart';
|
import 'services/ads.dart';
|
||||||
|
import 'services/ambience.dart';
|
||||||
import 'services/narrator.dart';
|
import 'services/narrator.dart';
|
||||||
import 'services/progress.dart';
|
import 'services/progress.dart';
|
||||||
import 'ui/board.dart';
|
import 'ui/board.dart';
|
||||||
|
import 'ui/discovery.dart';
|
||||||
import 'ui/paper.dart';
|
import 'ui/paper.dart';
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
@@ -73,7 +75,9 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
Game get g => widget.game;
|
Game get g => widget.game;
|
||||||
Progress get prefs => g.progress;
|
Progress get prefs => g.progress;
|
||||||
late final Narrator narrator;
|
late final Narrator narrator;
|
||||||
|
late final Ambience ambience;
|
||||||
late final Ads ads;
|
late final Ads ads;
|
||||||
|
bool _foreground = true;
|
||||||
String _route = '';
|
String _route = '';
|
||||||
String get route =>
|
String get route =>
|
||||||
'${g.screen.name}:${g.screen == Screen.story ? g.storyIndex : g.campaignIndex}';
|
'${g.screen.name}:${g.screen == Screen.story ? g.storyIndex : g.campaignIndex}';
|
||||||
@@ -81,12 +85,15 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
narrator = Narrator(g.book.tracks);
|
narrator = Narrator(g.book.tracks);
|
||||||
|
ambience = Ambience();
|
||||||
|
narrator.addListener(_syncAtmosphere);
|
||||||
ads = Ads(enabled: widget.adsEnabled);
|
ads = Ads(enabled: widget.adsEnabled);
|
||||||
g.addListener(_changed);
|
g.addListener(_changed);
|
||||||
_route = route;
|
_route = route;
|
||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
unawaited(ads.start());
|
unawaited(ads.start());
|
||||||
|
_syncAtmosphere();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,11 +102,35 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
_route = route;
|
_route = route;
|
||||||
unawaited(narrator.stop());
|
unawaited(narrator.stop());
|
||||||
}
|
}
|
||||||
|
_syncAtmosphere();
|
||||||
if (mounted) setState(() {});
|
if (mounted) setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool get atmosphereEnabled =>
|
||||||
|
!prefs.contains('ambience_enabled') || prefs.flag('ambience_enabled');
|
||||||
|
|
||||||
|
void _syncAtmosphere() {
|
||||||
|
final inStory =
|
||||||
|
g.mode == Mode.campaign &&
|
||||||
|
[
|
||||||
|
Screen.story,
|
||||||
|
Screen.briefing,
|
||||||
|
Screen.game,
|
||||||
|
Screen.reveal,
|
||||||
|
].contains(g.screen);
|
||||||
|
ambience.update(
|
||||||
|
scene: inStory ? soundscapeFor(g.campaignIndex) : null,
|
||||||
|
enabled: atmosphereEnabled,
|
||||||
|
foreground: _foreground,
|
||||||
|
narrating: narrator.playing || narrator.loading,
|
||||||
|
volume: prefs.decimal('ambience_volume', .7),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||||
|
_foreground = state == AppLifecycleState.resumed;
|
||||||
|
_syncAtmosphere();
|
||||||
if (state != AppLifecycleState.resumed) {
|
if (state != AppLifecycleState.resumed) {
|
||||||
unawaited(narrator.stop());
|
unawaited(narrator.stop());
|
||||||
unawaited(prefs.flushed);
|
unawaited(prefs.flushed);
|
||||||
@@ -110,6 +141,8 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
void dispose() {
|
void dispose() {
|
||||||
WidgetsBinding.instance.removeObserver(this);
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
g.removeListener(_changed);
|
g.removeListener(_changed);
|
||||||
|
narrator.removeListener(_syncAtmosphere);
|
||||||
|
ambience.dispose();
|
||||||
narrator.dispose();
|
narrator.dispose();
|
||||||
ads.dispose();
|
ads.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
@@ -225,7 +258,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
if (mounted) g.reveal(index, readAhead: true);
|
if (mounted) g.reveal(index, readAhead: true);
|
||||||
case Screen.reveal:
|
case Screen.reveal:
|
||||||
if (direction < 0) {
|
if (direction < 0) {
|
||||||
g.briefing(index);
|
g.startCampaign(index);
|
||||||
} else {
|
} else {
|
||||||
nextCampaign();
|
nextCampaign();
|
||||||
}
|
}
|
||||||
@@ -270,8 +303,9 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
} else {
|
} else {
|
||||||
g.home();
|
g.home();
|
||||||
}
|
}
|
||||||
case Screen.briefing:
|
|
||||||
case Screen.reveal:
|
case Screen.reveal:
|
||||||
|
g.startCampaign(g.campaignIndex);
|
||||||
|
case Screen.briefing:
|
||||||
g.contents();
|
g.contents();
|
||||||
case Screen.game:
|
case Screen.game:
|
||||||
if (g.mode == Mode.campaign) {
|
if (g.mode == Mode.campaign) {
|
||||||
@@ -415,6 +449,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
() => unawaited(g.startPractice()),
|
() => unawaited(g.startPractice()),
|
||||||
),
|
),
|
||||||
action('How to play', rules),
|
action('How to play', rules),
|
||||||
|
action('Sound & atmosphere', soundSettings),
|
||||||
action('Privacy & advertising', privacy),
|
action('Privacy & advertising', privacy),
|
||||||
action(
|
action(
|
||||||
'Open-source licenses',
|
'Open-source licenses',
|
||||||
@@ -526,7 +561,10 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
listenable: narrator,
|
listenable: narrator,
|
||||||
builder: (context, _) => column([
|
builder: (context, _) => column([
|
||||||
writing(
|
writing(
|
||||||
g.book.tracks[recordingId]?['speaker'] == 'Narrator'
|
(narrator.page == recordingId
|
||||||
|
? narrator.speaker
|
||||||
|
: g.book.tracks[recordingId]?['speaker']) ==
|
||||||
|
'Narrator'
|
||||||
? 'Narrator · recorded story'
|
? 'Narrator · recorded story'
|
||||||
: 'Mara · diary reading',
|
: 'Mara · diary reading',
|
||||||
size: 17,
|
size: 17,
|
||||||
@@ -554,6 +592,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
writing(narrator.status, size: 17, color: muted),
|
writing(narrator.status, size: 17, color: muted),
|
||||||
|
InkButton('Sound & atmosphere', soundSettings, size: 18),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
Widget story() {
|
Widget story() {
|
||||||
@@ -583,6 +622,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
),
|
),
|
||||||
writing(p.speaker, size: 17, color: muted),
|
writing(p.speaker, size: 17, color: muted),
|
||||||
reading(p.text),
|
reading(p.text),
|
||||||
|
if (p.continuation.isNotEmpty) reading(p.continuation),
|
||||||
if (g.book.tracks.containsKey(p.id)) audio(),
|
if (g.book.tracks.containsKey(p.id)) audio(),
|
||||||
if (p.campaignIndex != 0)
|
if (p.campaignIndex != 0)
|
||||||
action('Turn to the pattern →', () => turn(1)),
|
action('Turn to the pattern →', () => turn(1)),
|
||||||
@@ -610,10 +650,12 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
color: muted,
|
color: muted,
|
||||||
),
|
),
|
||||||
reading(p.text),
|
reading(p.text),
|
||||||
|
if (p.continuation.isNotEmpty) reading(p.continuation),
|
||||||
if (g.book.tracks.containsKey(p.id)) audio(),
|
if (g.book.tracks.containsKey(p.id)) audio(),
|
||||||
if (!g.recovered(p.campaignIndex!))
|
|
||||||
action(
|
action(
|
||||||
'Return to this pattern',
|
g.recovered(p.campaignIndex!)
|
||||||
|
? 'View the solved pattern'
|
||||||
|
: 'Return to this pattern',
|
||||||
() => g.showStory(
|
() => g.showStory(
|
||||||
g.book.pageFor(p.campaignIndex!, StoryPageType.puzzle),
|
g.book.pageFor(p.campaignIndex!, StoryPageType.puzzle),
|
||||||
),
|
),
|
||||||
@@ -734,6 +776,65 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> soundSettings() => showDialog<void>(
|
||||||
|
context: context,
|
||||||
|
builder: (dialogContext) => StatefulBuilder(
|
||||||
|
builder: (context, refresh) {
|
||||||
|
void save(String key, Object value) {
|
||||||
|
unawaited(prefs.set(key, value));
|
||||||
|
_syncAtmosphere();
|
||||||
|
if (mounted) setState(() {});
|
||||||
|
refresh(() {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text('Sound & atmosphere', style: hand(29)),
|
||||||
|
content: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SwitchListTile(
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
title: Text('Environmental sounds', style: hand(23)),
|
||||||
|
value: atmosphereEnabled,
|
||||||
|
onChanged: (value) => save('ambience_enabled', value),
|
||||||
|
),
|
||||||
|
writing(
|
||||||
|
'Water at the harbour and bridge, wind around the tower. The atmosphere grows quieter while the story is read.',
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
writing('Atmosphere volume', size: 20),
|
||||||
|
Slider(
|
||||||
|
label:
|
||||||
|
'${(prefs.decimal('ambience_volume', .7) * 100).round()}%',
|
||||||
|
value: prefs.decimal('ambience_volume', .7).clamp(0.0, 1.0),
|
||||||
|
divisions: 10,
|
||||||
|
onChanged: atmosphereEnabled
|
||||||
|
? (value) => save('ambience_volume', value)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
writing(
|
||||||
|
'Readings play when you press Play. Your device volume controls the voice.',
|
||||||
|
size: 18,
|
||||||
|
color: muted,
|
||||||
|
),
|
||||||
|
if (ambience.error.isNotEmpty)
|
||||||
|
writing(ambience.error, size: 18),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(dialogContext),
|
||||||
|
child: const Text('Keep going'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
Widget contents() {
|
Widget contents() {
|
||||||
final chapter = g.contentsChapter;
|
final chapter = g.contentsChapter;
|
||||||
final first = chapter * 4;
|
final first = chapter * 4;
|
||||||
@@ -827,6 +928,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
writing(l.title, size: 33),
|
writing(l.title, size: 33),
|
||||||
gap(),
|
gap(),
|
||||||
reading(l.before, size: 25),
|
reading(l.before, size: 25),
|
||||||
|
if (l.beforeContinuation.isNotEmpty) reading(l.beforeContinuation),
|
||||||
if (g.book.tracks.containsKey(recordingId)) audio(),
|
if (g.book.tracks.containsKey(recordingId)) audio(),
|
||||||
divider(),
|
divider(),
|
||||||
writing(
|
writing(
|
||||||
@@ -837,7 +939,9 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
color: muted,
|
color: muted,
|
||||||
),
|
),
|
||||||
action(
|
action(
|
||||||
prefs.contains('grid_story_v1_${g.campaignIndex}')
|
g.recovered(g.campaignIndex)
|
||||||
|
? 'View the solved pattern →'
|
||||||
|
: prefs.contains('grid_story_v1_${g.campaignIndex}')
|
||||||
? 'Continue this pattern →'
|
? 'Continue this pattern →'
|
||||||
: 'Restore the pattern →',
|
: 'Restore the pattern →',
|
||||||
() => g.startCampaign(g.campaignIndex),
|
() => g.startCampaign(g.campaignIndex),
|
||||||
@@ -884,6 +988,8 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> puzzleNotes() => [
|
List<Widget> puzzleNotes() => [
|
||||||
|
if (g.mode == Mode.campaign)
|
||||||
|
InkButton('Sound & atmosphere', soundSettings, size: 18),
|
||||||
writing(
|
writing(
|
||||||
g.won
|
g.won
|
||||||
? 'Already restored. Turn the leaf to revisit the memory.'
|
? 'Already restored. Turn the leaf to revisit the memory.'
|
||||||
@@ -904,7 +1010,9 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: InkButton(
|
child: InkButton(
|
||||||
prefs.flag('hint_${g.key}')
|
g.mode == Mode.campaign
|
||||||
|
? 'Hint · free'
|
||||||
|
: prefs.flag('hint_${g.key}')
|
||||||
? 'Hint · rewarded ad'
|
? 'Hint · rewarded ad'
|
||||||
: 'Hint · free',
|
: 'Hint · free',
|
||||||
hint,
|
hint,
|
||||||
@@ -984,8 +1092,14 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
(
|
(
|
||||||
label: g.mode == Mode.daily
|
label: g.mode == Mode.daily
|
||||||
? 'Return to the notebook'
|
? 'Return to the notebook'
|
||||||
|
: g.mode == Mode.campaign
|
||||||
|
? 'Revisit the memory →'
|
||||||
: 'Next puzzle →',
|
: 'Next puzzle →',
|
||||||
run: g.mode == Mode.daily ? g.home : nextPractice,
|
run: g.mode == Mode.daily
|
||||||
|
? g.home
|
||||||
|
: g.mode == Mode.campaign
|
||||||
|
? () => g.reveal(g.campaignIndex)
|
||||||
|
: nextPractice,
|
||||||
primary: true,
|
primary: true,
|
||||||
),
|
),
|
||||||
(label: 'How to play', run: rules, primary: false),
|
(label: 'How to play', run: rules, primary: false),
|
||||||
@@ -1068,7 +1182,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!prefs.flag('hint_$requested')) {
|
if (g.mode == Mode.campaign || !prefs.flag('hint_$requested')) {
|
||||||
await prefs.set('hint_$requested', true);
|
await prefs.set('hint_$requested', true);
|
||||||
give();
|
give();
|
||||||
return;
|
return;
|
||||||
@@ -1110,7 +1224,12 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (level.illustrationAsset case final asset?) {
|
if (level.illustrationAsset case final asset?) {
|
||||||
return Image.asset(
|
return Discovery(
|
||||||
|
key: ValueKey('discovery-${g.campaignIndex}'),
|
||||||
|
picture: level.picture,
|
||||||
|
label: level.object,
|
||||||
|
height: height,
|
||||||
|
artwork: Image.asset(
|
||||||
asset,
|
asset,
|
||||||
height: height,
|
height: height,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
@@ -1118,6 +1237,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
semanticLabel: 'Watercolour illustration: ${level.object}',
|
semanticLabel: 'Watercolour illustration: ${level.object}',
|
||||||
errorBuilder: (_, _, _) =>
|
errorBuilder: (_, _, _) =>
|
||||||
PixelPicture(level.picture, label: level.object, height: height),
|
PixelPicture(level.picture, label: level.object, height: height),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return PixelPicture(level.picture, label: level.object, height: height);
|
return PixelPicture(level.picture, label: level.object, height: height);
|
||||||
@@ -1140,9 +1260,12 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
writing(l.object, size: 35),
|
writing(l.object, size: 35),
|
||||||
discoveryArt(l),
|
discoveryArt(l),
|
||||||
reading(l.after, size: 25),
|
reading(l.after, size: 25),
|
||||||
|
if (l.afterContinuation.isNotEmpty) reading(l.afterContinuation),
|
||||||
if (g.book.tracks.containsKey(recordingId)) audio(),
|
if (g.book.tracks.containsKey(recordingId)) audio(),
|
||||||
if (!g.recovered(i))
|
action(
|
||||||
action('Return to this pattern', () => g.startCampaign(i)),
|
g.recovered(i) ? 'View the solved pattern' : 'Return to this pattern',
|
||||||
|
() => g.startCampaign(i),
|
||||||
|
),
|
||||||
gap(),
|
gap(),
|
||||||
writing(
|
writing(
|
||||||
g.recovered(i)
|
g.recovered(i)
|
||||||
@@ -1193,7 +1316,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
|
|||||||
|
|
||||||
void rules() => message(
|
void rules() => message(
|
||||||
'Find the light',
|
'Find the light',
|
||||||
'Light exactly as many cells as the number beside each row and above each column.\n\nTap to cycle: empty → light → crossed out → empty. Mark every cell to finish. Small dots mark fixed clues.\n\nA, B and C are overlapping areas with their own totals. Shared cells count in both areas. Compare clues and subtract their shared parts to find new deductions.\n\nEvery story grid reveals an object. Later pages require area comparisons; all are solvable without guessing. Classic practice grades the length of simpler row and column chains.\n\nOne free explained hint per puzzle, then optional rewarded hints. Streaks count consecutive daily completions on this device.',
|
'Light exactly as many cells as the number beside each row and above each column.\n\nTap to cycle: empty → light → crossed out → empty. Mark every cell to finish. Small dots mark fixed clues.\n\nA, B and C are overlapping areas with their own totals. Shared cells count in both areas. Compare clues and subtract their shared parts to find new deductions.\n\nEvery story grid reveals an object. Later pages require area comparisons; all are solvable without guessing. Classic practice grades the length of simpler row and column chains.\n\nStory hints are always free and explained. Daily and classic puzzles offer one free hint, then optional rewarded hints. Streaks count consecutive daily completions on this device.',
|
||||||
close: 'Got it',
|
close: 'Got it',
|
||||||
);
|
);
|
||||||
Future<void> privacy() async {
|
Future<void> privacy() async {
|
||||||
|
|||||||
@@ -0,0 +1,145 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:audio_session/audio_session.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:just_audio/just_audio.dart';
|
||||||
|
|
||||||
|
enum Soundscape { cottage, harbour, bridge, tower }
|
||||||
|
|
||||||
|
Soundscape soundscapeFor(int campaignIndex) => switch (campaignIndex) {
|
||||||
|
4 || 5 || 7 => Soundscape.harbour,
|
||||||
|
6 => Soundscape.bridge,
|
||||||
|
8 || 9 || 10 => Soundscape.tower,
|
||||||
|
_ => Soundscape.cottage,
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Small output boundary lets tests exercise races and fades without a device.
|
||||||
|
abstract interface class AmbienceOutput {
|
||||||
|
Future<void> load(Soundscape scene);
|
||||||
|
Future<void> volume(double value);
|
||||||
|
Future<void> play();
|
||||||
|
Future<void> stop();
|
||||||
|
Future<void> dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AudioOutput implements AmbienceOutput {
|
||||||
|
// One shared speech session; this layer must not steal focus from the voice.
|
||||||
|
final _player = AudioPlayer(handleAudioSessionActivation: false);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> load(Soundscape scene) async {
|
||||||
|
final session = await AudioSession.instance;
|
||||||
|
await session.configure(const AudioSessionConfiguration.speech());
|
||||||
|
if (!await session.setActive(true)) {
|
||||||
|
throw StateError('Audio focus unavailable');
|
||||||
|
}
|
||||||
|
await _player.setLoopMode(LoopMode.one);
|
||||||
|
await _player.setAsset('assets/audio/ambience_${scene.name}.wav');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> volume(double value) => _player.setVolume(value);
|
||||||
|
@override
|
||||||
|
Future<void> play() => _player.play();
|
||||||
|
@override
|
||||||
|
Future<void> stop() => _player.stop();
|
||||||
|
@override
|
||||||
|
Future<void> dispose() => _player.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Serialises scene changes, fading out old audio before loading the next loop.
|
||||||
|
/// The newest request wins, including mute/background requests during loading.
|
||||||
|
class Ambience extends ChangeNotifier {
|
||||||
|
Ambience({AmbienceOutput? output}) : _output = output ?? _AudioOutput();
|
||||||
|
final AmbienceOutput _output;
|
||||||
|
Future<void> _pending = Future.value();
|
||||||
|
int _revision = 0;
|
||||||
|
bool _disposed = false;
|
||||||
|
Soundscape? _desired, _loaded;
|
||||||
|
double _target = 0, _volume = 0;
|
||||||
|
String error = '';
|
||||||
|
|
||||||
|
Future<void> get settled => _pending;
|
||||||
|
|
||||||
|
void update({
|
||||||
|
required Soundscape? scene,
|
||||||
|
required bool enabled,
|
||||||
|
required bool foreground,
|
||||||
|
required bool narrating,
|
||||||
|
required double volume,
|
||||||
|
}) {
|
||||||
|
if (_disposed) return;
|
||||||
|
final desired = enabled && foreground ? scene : null;
|
||||||
|
final target = desired == null
|
||||||
|
? 0.0
|
||||||
|
: .4 * volume.clamp(0.0, 1.0) * (narrating ? .25 : 1);
|
||||||
|
if (_desired == desired && _target == target) return;
|
||||||
|
_desired = desired;
|
||||||
|
_target = target;
|
||||||
|
final revision = ++_revision;
|
||||||
|
_pending = _pending.then((_) => _apply(revision));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _current(int revision) => !_disposed && revision == _revision;
|
||||||
|
|
||||||
|
Future<void> _fade(double target, int revision) async {
|
||||||
|
final start = _volume;
|
||||||
|
for (var i = 1; i <= 8 && _current(revision); i++) {
|
||||||
|
_volume = start + (target - start) * i / 8;
|
||||||
|
await _output.volume(_volume);
|
||||||
|
await Future<void>.delayed(const Duration(milliseconds: 30));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _apply(int revision) async {
|
||||||
|
if (!_current(revision)) return;
|
||||||
|
try {
|
||||||
|
final scene = _desired;
|
||||||
|
if (scene != _loaded || scene == null) {
|
||||||
|
// Muting/backgrounding stops immediately; scene changes fade gently.
|
||||||
|
if (scene != null && _loaded != null) await _fade(0, revision);
|
||||||
|
if (!_current(revision)) return;
|
||||||
|
await _output.stop();
|
||||||
|
_loaded = null;
|
||||||
|
_volume = 0;
|
||||||
|
await _output.volume(0);
|
||||||
|
if (scene == null || !_current(revision)) return;
|
||||||
|
await _output.load(scene);
|
||||||
|
if (!_current(revision)) return;
|
||||||
|
error = '';
|
||||||
|
_loaded = scene;
|
||||||
|
unawaited(
|
||||||
|
_output.play().catchError((Object _) {
|
||||||
|
if (_current(revision)) _failed();
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
await _fade(_target, revision);
|
||||||
|
} catch (_) {
|
||||||
|
if (!_disposed) {
|
||||||
|
try {
|
||||||
|
await _output.stop();
|
||||||
|
} catch (_) {
|
||||||
|
// A missing or unavailable audio backend must not break the book.
|
||||||
|
}
|
||||||
|
_loaded = null;
|
||||||
|
_failed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _failed() {
|
||||||
|
if (_disposed) return;
|
||||||
|
error =
|
||||||
|
'The atmosphere could not be played. Your reading is still available.';
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_disposed = true;
|
||||||
|
++_revision;
|
||||||
|
unawaited(_pending.whenComplete(_output.dispose));
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,6 +51,16 @@ class Narrator extends ChangeNotifier {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get speaker {
|
||||||
|
for (final cue in tracks[page]?['cues'] ?? []) {
|
||||||
|
if (position.inMilliseconds >= cue['startMs'] &&
|
||||||
|
position.inMilliseconds < cue['endMs']) {
|
||||||
|
return cue['speaker'] ?? tracks[page]?['speaker'] ?? '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tracks[page]?['speaker'] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> toggle(String id, double speed) async {
|
Future<void> toggle(String id, double speed) async {
|
||||||
if (loading) return;
|
if (loading) return;
|
||||||
if (playing && page == id) {
|
if (playing && page == id) {
|
||||||
|
|||||||
@@ -293,6 +293,28 @@ class PixelPicture extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class PatternStamp extends StatelessWidget {
|
||||||
|
const PatternStamp(
|
||||||
|
this.picture, {
|
||||||
|
super.key,
|
||||||
|
required this.label,
|
||||||
|
required this.height,
|
||||||
|
});
|
||||||
|
final List<int> picture;
|
||||||
|
final String label;
|
||||||
|
final double height;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => Semantics(
|
||||||
|
image: true,
|
||||||
|
label: 'Your restored seven by seven pattern: $label',
|
||||||
|
child: SizedBox.square(
|
||||||
|
dimension: height,
|
||||||
|
child: CustomPaint(painter: _Pixels(picture)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
class _Pixels extends CustomPainter {
|
class _Pixels extends CustomPainter {
|
||||||
_Pixels(this.picture);
|
_Pixels(this.picture);
|
||||||
final List<int> picture;
|
final List<int> picture;
|
||||||
|
|||||||
@@ -0,0 +1,108 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'board.dart';
|
||||||
|
import 'paper.dart';
|
||||||
|
|
||||||
|
/// The exact solved symbol becomes the illustration, and stays on the page.
|
||||||
|
class Discovery extends StatefulWidget {
|
||||||
|
const Discovery({
|
||||||
|
super.key,
|
||||||
|
required this.picture,
|
||||||
|
required this.label,
|
||||||
|
required this.artwork,
|
||||||
|
required this.height,
|
||||||
|
});
|
||||||
|
final List<int> picture;
|
||||||
|
final String label;
|
||||||
|
final Widget artwork;
|
||||||
|
final double height;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Discovery> createState() => _DiscoveryState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DiscoveryState extends State<Discovery>
|
||||||
|
with SingleTickerProviderStateMixin {
|
||||||
|
late final AnimationController _animation = AnimationController(
|
||||||
|
vsync: this,
|
||||||
|
duration: const Duration(milliseconds: 2800),
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeDependencies() {
|
||||||
|
super.didChangeDependencies();
|
||||||
|
if (MediaQuery.disableAnimationsOf(context)) {
|
||||||
|
_animation.value = 1;
|
||||||
|
} else if (_animation.isDismissed) {
|
||||||
|
_animation.forward();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_animation.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => Column(
|
||||||
|
children: [
|
||||||
|
AnimatedBuilder(
|
||||||
|
animation: _animation,
|
||||||
|
builder: (context, _) {
|
||||||
|
final art = const Interval(
|
||||||
|
.3,
|
||||||
|
.85,
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
).transform(_animation.value);
|
||||||
|
final pattern =
|
||||||
|
1 -
|
||||||
|
const Interval(
|
||||||
|
.45,
|
||||||
|
.95,
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
).transform(_animation.value);
|
||||||
|
return SizedBox(
|
||||||
|
height: widget.height,
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
Opacity(opacity: art, child: widget.artwork),
|
||||||
|
ExcludeSemantics(
|
||||||
|
child: Opacity(
|
||||||
|
opacity: pattern,
|
||||||
|
child: PatternStamp(
|
||||||
|
widget.picture,
|
||||||
|
label: widget.label,
|
||||||
|
height: widget.height,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
PatternStamp(widget.picture, label: widget.label, height: 56),
|
||||||
|
const SizedBox(width: 14),
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
'Your restored pattern\n${widget.label}',
|
||||||
|
style: hand(18, color: muted),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (!MediaQuery.disableAnimationsOf(context))
|
||||||
|
InkButton(
|
||||||
|
'See the transformation again',
|
||||||
|
() => _animation.forward(from: 0),
|
||||||
|
size: 18,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -42,6 +42,11 @@ flutter:
|
|||||||
- assets/artwork/home-vignette-v1.png
|
- assets/artwork/home-vignette-v1.png
|
||||||
- assets/narration/scripts.json
|
- assets/narration/scripts.json
|
||||||
- assets/audio/narration_manifest.json
|
- assets/audio/narration_manifest.json
|
||||||
|
- assets/audio/ambience_manifest.json
|
||||||
|
- assets/audio/ambience_cottage.wav
|
||||||
|
- assets/audio/ambience_harbour.wav
|
||||||
|
- assets/audio/ambience_bridge.wav
|
||||||
|
- assets/audio/ambience_tower.wav
|
||||||
- assets/audio/narration_cottage_dedication.wav
|
- assets/audio/narration_cottage_dedication.wav
|
||||||
- assets/audio/narration_cottage_window.wav
|
- assets/audio/narration_cottage_window.wav
|
||||||
- assets/audio/narration_cottage_match_memory.wav
|
- assets/audio/narration_cottage_match_memory.wav
|
||||||
|
|||||||
@@ -14,13 +14,21 @@ assert {r['pageId'] for r in canonical}==set(manifest['tracks'])
|
|||||||
for record in canonical:
|
for record in canonical:
|
||||||
if record['pageId'].startswith('campaign.'):
|
if record['pageId'].startswith('campaign.'):
|
||||||
_,index,phase=record['pageId'].split('.')
|
_,index,phase=record['pageId'].split('.')
|
||||||
assert record['text']==campaign[int(index)][phase], 'Campaign narration is stale'
|
level=campaign[int(index)]
|
||||||
|
expected='\n\n'.join(p for p in [level[phase],level.get(phase+'Continuation','')] if p)
|
||||||
|
assert record['text']==expected, 'Campaign narration is stale'
|
||||||
elif record.get('speaker')=='Narrator':
|
elif record.get('speaker')=='Narrator':
|
||||||
page=pages[record['pageId']]
|
page=pages[record['pageId']]
|
||||||
expected=campaign[page['campaignIndex']][page['textSource']] if page.get('textSource') in ('before','after') else page['text']
|
if page.get('textSource') in ('before','after'):
|
||||||
|
level=campaign[page['campaignIndex']];phase=page['textSource']
|
||||||
|
expected='\n\n'.join(p for p in [level[phase],page.get('continuation',level.get(phase+'Continuation',''))] if p)
|
||||||
|
else:expected='\n\n'.join(p for p in [page['text'],page.get('continuation','')] if p)
|
||||||
assert record['text']==expected, 'Notebook narration is stale'
|
assert record['text']==expected, 'Notebook narration is stale'
|
||||||
track=manifest['tracks'][record['pageId']]
|
track=manifest['tracks'][record['pageId']]
|
||||||
assert track['text']==record['text']
|
assert track['text']==record['text']
|
||||||
|
if record.get('continuation'):
|
||||||
|
assert record['text']==record['baseText']+'\n\n'+record['continuation']
|
||||||
|
assert track['continuationSpeaker']=='Narrator'
|
||||||
assert track['textSha256']==hashlib.sha256(record['text'].encode()).hexdigest()
|
assert track['textSha256']==hashlib.sha256(record['text'].encode()).hexdigest()
|
||||||
assert track['resource']==record['resource']
|
assert track['resource']==record['resource']
|
||||||
if record.get('speaker')=='Narrator':
|
if record.get('speaker')=='Narrator':
|
||||||
@@ -39,6 +47,8 @@ for record in canonical:
|
|||||||
assert reader.getnchannels()==1 and reader.getsampwidth()==2 and reader.getframerate()==24000
|
assert reader.getnchannels()==1 and reader.getsampwidth()==2 and reader.getframerate()==24000
|
||||||
assert reader.getnframes()==track['frames']
|
assert reader.getnframes()==track['frames']
|
||||||
master=reader.readframes(reader.getnframes())
|
master=reader.readframes(reader.getnframes())
|
||||||
|
if track.get('originalFrames'):
|
||||||
|
assert hashlib.sha256(master[:track['originalFrames']*2]).hexdigest()==track['originalPcmSha256'],'Original take was changed'
|
||||||
samples=array.array('h',master);peak=max(abs(v) for v in samples)
|
samples=array.array('h',master);peak=max(abs(v) for v in samples)
|
||||||
assert 1000<peak<32767,'Silent or clipped audio'
|
assert 1000<peak<32767,'Silent or clipped audio'
|
||||||
decoded=subprocess.check_output(['ffmpeg','-v','error','-i',str(flac),'-f','s16le','-acodec','pcm_s16le','-'])
|
decoded=subprocess.check_output(['ffmpeg','-v','error','-i',str(flac),'-f','s16le','-acodec','pcm_s16le','-'])
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Check bundled soundscapes without synthesis dependencies."""
|
||||||
|
import array
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
|
import math
|
||||||
|
import wave
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
root = Path(__file__).resolve().parents[1]
|
||||||
|
audio = root / 'assets/audio'
|
||||||
|
manifest = json.loads((audio / 'ambience_manifest.json').read_text())
|
||||||
|
assert set(manifest['tracks']) == {'cottage', 'harbour', 'bridge', 'tower'}
|
||||||
|
pubspec = (root / 'pubspec.yaml').read_text()
|
||||||
|
for scene, track in manifest['tracks'].items():
|
||||||
|
path = audio / track['file']
|
||||||
|
assert 'assets/audio/' + path.name in pubspec
|
||||||
|
assert hashlib.sha256(path.read_bytes()).hexdigest() == track['wavSha256']
|
||||||
|
with wave.open(str(path), 'rb') as reader:
|
||||||
|
assert reader.getnchannels() == 1 and reader.getsampwidth() == 2
|
||||||
|
assert reader.getframerate() == track['sampleRate'] == 24000
|
||||||
|
assert reader.getnframes() == track['frames']
|
||||||
|
samples = array.array('h', reader.readframes(reader.getnframes()))
|
||||||
|
rms = math.sqrt(sum(v * v for v in samples) / len(samples)) / 32768
|
||||||
|
peak = max(abs(v) for v in samples) / 32768
|
||||||
|
assert .05 < rms < .15 and peak < .73, 'Silent or clipped soundscape'
|
||||||
|
assert abs(samples[-1] - samples[0]) <= 1, 'Discontinuous loop join'
|
||||||
|
assert track['durationMs'] == len(samples) * 1000 // 24000
|
||||||
|
print(f'PASS {scene}: bundled PCM, checksum, level and loop join verified')
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Render original, deterministic sound textures; no downloaded samples or runtime synthesis."""
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
import numpy as np
|
||||||
|
import soundfile as sf
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
RATE = 24000
|
||||||
|
SECONDS = 24
|
||||||
|
N = RATE * SECONDS
|
||||||
|
T = np.arange(N) / RATE
|
||||||
|
F = np.fft.rfftfreq(N, 1 / RATE)
|
||||||
|
OUT = ROOT / 'assets/audio'
|
||||||
|
|
||||||
|
|
||||||
|
def render(scene, seed):
|
||||||
|
rng = np.random.default_rng(seed)
|
||||||
|
|
||||||
|
def noise(low, high):
|
||||||
|
spectrum = np.fft.rfft(rng.normal(size=N))
|
||||||
|
spectrum *= (1 - np.exp(-(F / low) ** 4)) * np.exp(-(F / high) ** 2)
|
||||||
|
signal = np.fft.irfft(spectrum, n=N)
|
||||||
|
return signal / np.sqrt(np.mean(signal ** 2))
|
||||||
|
|
||||||
|
def swell(cycles, depth, phase):
|
||||||
|
return 1 + depth * np.sin(2 * np.pi * cycles * T / SECONDS + phase)
|
||||||
|
|
||||||
|
if scene == 'cottage':
|
||||||
|
# Air through trees beyond the shutter, with very soft timber movement.
|
||||||
|
signal = .65 * noise(100, 1250) * swell(2, .35, .3)
|
||||||
|
signal += .12 * noise(600, 3200) * swell(5, .4, 1.8)
|
||||||
|
for centre in [5.2, 14.1, 20.3]:
|
||||||
|
distance = (T - centre + SECONDS / 2) % SECONDS - SECONDS / 2
|
||||||
|
signal += .045 * np.sin(2 * np.pi * 270 * T) * np.exp(-(distance / .12) ** 2)
|
||||||
|
elif scene == 'harbour':
|
||||||
|
# Uneven small swells and a brighter wash as water meets the harbour wall.
|
||||||
|
signal = .8 * noise(70, 1700) * swell(7, .5, .5) * swell(3, .3, 1.3)
|
||||||
|
signal += .25 * noise(900, 4800) * swell(7, .6, 1.6)
|
||||||
|
elif scene == 'bridge':
|
||||||
|
# Continuous current under the stones, with irregular surface turbulence.
|
||||||
|
signal = .8 * noise(260, 6500) * swell(3, .18, .9) * swell(11, .15, 2.1)
|
||||||
|
signal += .4 * noise(80, 1800) * swell(5, .28, 1.8)
|
||||||
|
elif scene == 'tower':
|
||||||
|
# Sheltered low wind around the tower, with gentle gusts above it.
|
||||||
|
signal = .8 * noise(45, 700) * swell(2, .55, 1.2)
|
||||||
|
signal += .2 * noise(400, 2200) * swell(4, .65, .2)
|
||||||
|
else:
|
||||||
|
raise ValueError(scene)
|
||||||
|
signal -= np.mean(signal)
|
||||||
|
# Ease the last 50 ms onto the first sample, without a discontinuity at wrap.
|
||||||
|
ramp = np.linspace(0, 1, RATE // 20)
|
||||||
|
signal[-len(ramp):] -= (signal[-1] - signal[0]) * ramp * ramp * (3 - 2 * ramp)
|
||||||
|
signal *= .13 / np.sqrt(np.mean(signal ** 2))
|
||||||
|
signal *= min(1, .72 / np.max(np.abs(signal)))
|
||||||
|
return signal
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
tracks = {}
|
||||||
|
for scene, seed in [('cottage', 104), ('harbour', 205), ('bridge', 306), ('tower', 407)]:
|
||||||
|
path = OUT / f'ambience_{scene}.wav'
|
||||||
|
sf.write(path, render(scene, seed), RATE, subtype='PCM_16')
|
||||||
|
samples, rate = sf.read(path)
|
||||||
|
assert rate == RATE and len(samples) == N
|
||||||
|
assert .05 < np.sqrt(np.mean(samples ** 2)) < .15
|
||||||
|
assert np.max(np.abs(samples)) < .73
|
||||||
|
# A loop join must have no exceptional jump compared with normal samples.
|
||||||
|
assert abs(samples[-1] - samples[0]) <= 1 / 32768
|
||||||
|
tracks[scene] = {
|
||||||
|
'file': path.name, 'sampleRate': RATE, 'channels': 1,
|
||||||
|
'durationMs': SECONDS * 1000, 'frames': N, 'seed': seed,
|
||||||
|
'wavSha256': hashlib.sha256(path.read_bytes()).hexdigest(),
|
||||||
|
}
|
||||||
|
print(f'{scene}: {SECONDS}s loop, peak {np.max(np.abs(samples)):.3f}, RMS {np.sqrt(np.mean(samples ** 2)):.3f}')
|
||||||
|
(OUT / 'ambience_manifest.json').write_text(json.dumps({
|
||||||
|
'method': 'Original procedural sound textures rendered offline by scripts/render_ambience.py; no third-party samples.',
|
||||||
|
'tracks': tracks,
|
||||||
|
}, indent=2) + '\n')
|
||||||
@@ -15,6 +15,7 @@ parser.add_argument('--voices',type=Path,required=True)
|
|||||||
parser.add_argument('--voice',default='bf_emma')
|
parser.add_argument('--voice',default='bf_emma')
|
||||||
parser.add_argument('--speed',type=float,default=.82)
|
parser.add_argument('--speed',type=float,default=.82)
|
||||||
parser.add_argument('--speaker', help='Render only this speaker, preserving all other recordings')
|
parser.add_argument('--speaker', help='Render only this speaker, preserving all other recordings')
|
||||||
|
parser.add_argument('--append-continuations', action='store_true', help='Preserve existing takes and append the new narrator passages')
|
||||||
parser.add_argument('--root',type=Path,default=Path(__file__).resolve().parents[1])
|
parser.add_argument('--root',type=Path,default=Path(__file__).resolve().parents[1])
|
||||||
a=parser.parse_args()
|
a=parser.parse_args()
|
||||||
source=a.root/'assets/narration';raw=a.root/'assets/audio'
|
source=a.root/'assets/narration';raw=a.root/'assets/audio'
|
||||||
@@ -25,28 +26,48 @@ session.disable_fallback()
|
|||||||
config=EspeakConfig(lib_path=str(espeakng_loader.get_library_path()),data_path=str(espeakng_loader.get_data_path()))
|
config=EspeakConfig(lib_path=str(espeakng_loader.get_library_path()),data_path=str(espeakng_loader.get_data_path()))
|
||||||
engine=Kokoro.from_session(session,str(a.voices),espeak_config=config)
|
engine=Kokoro.from_session(session,str(a.voices),espeak_config=config)
|
||||||
previous=json.loads((source/'manifest.json').read_text()) if (source/'manifest.json').exists() else {}
|
previous=json.loads((source/'manifest.json').read_text()) if (source/'manifest.json').exists() else {}
|
||||||
tracks=dict(previous.get('tracks',{})) if a.speaker else {}
|
tracks=dict(previous.get('tracks',{})) if a.speaker or a.append_continuations else {}
|
||||||
for record in json.loads((source/'scripts.json').read_text()):
|
for record in json.loads((source/'scripts.json').read_text()):
|
||||||
if a.speaker and record.get('speaker')!=a.speaker: continue
|
if a.speaker and record.get('speaker')!=a.speaker: continue
|
||||||
|
old=tracks.get(record['pageId'])
|
||||||
|
if a.append_continuations:
|
||||||
|
if old and old['text']==record['text']:
|
||||||
|
assert old['wavSha256']==hashlib.sha256((source/'wav'/old['file']).read_bytes()).hexdigest()
|
||||||
|
continue
|
||||||
|
assert old and old['text']==record['baseText'], f"Cannot append to stale take: {record['pageId']}"
|
||||||
paragraphs=[]
|
paragraphs=[]
|
||||||
for part in record['text'].split('\n\n'):
|
text=record['continuation'] if a.append_continuations else record.get('baseText',record['text'])
|
||||||
|
for part in text.split('\n\n'):
|
||||||
if paragraphs and len(part)<45:paragraphs[-1]+='\n\n'+part
|
if paragraphs and len(part)<45:paragraphs[-1]+='\n\n'+part
|
||||||
elif paragraphs and len(paragraphs[-1])<45:paragraphs[-1]+='\n\n'+part
|
elif paragraphs and len(paragraphs[-1])<45:paragraphs[-1]+='\n\n'+part
|
||||||
else:paragraphs.append(part)
|
else:paragraphs.append(part)
|
||||||
rate=24000;pieces=[np.zeros(int(rate*.18),dtype=np.float32)];frames=len(pieces[0]);cues=[]
|
rate=24000;pieces=[np.zeros(int(rate*.18),dtype=np.float32)];frames=len(pieces[0]);cues=[]
|
||||||
for part in paragraphs:
|
if a.append_continuations:
|
||||||
print(f"Rendering {record['pageId']} · {len(cues)+1}/{len(paragraphs)}",flush=True)
|
original,_=sf.read(source/'wav'/old['file'],dtype='int16')
|
||||||
samples,sample_rate=engine.create(part.replace('\n',' '),voice=record.get('voice',a.voice),speed=record.get('speed',a.speed),lang='en-gb',sentence_pause=.38,clause_pause=.14)
|
master,master_rate=sf.read(source/'wav'/old['file'],dtype='float32')
|
||||||
|
assert master_rate==rate
|
||||||
|
pieces=[master,np.zeros(int(rate*.18),dtype=np.float32)];frames=sum(len(p) for p in pieces)
|
||||||
|
cues=[{**c,'speaker':c.get('speaker',record['speaker'])} for c in old['cues']]
|
||||||
|
sections=[(part,'Narrator' if a.append_continuations else record['speaker']) for part in paragraphs]
|
||||||
|
if not a.append_continuations and record.get('continuation'):
|
||||||
|
sections.extend((part,'Narrator') for part in record['continuation'].split('\n\n'))
|
||||||
|
for number,(part,speaker) in enumerate(sections,1):
|
||||||
|
print(f"Rendering {record['pageId']} · {number}/{len(sections)}",flush=True)
|
||||||
|
voice='bm_george' if speaker=='Narrator' else record.get('voice',a.voice)
|
||||||
|
speed=.88 if speaker=='Narrator' else record.get('speed',a.speed)
|
||||||
|
samples,sample_rate=engine.create(part.replace('\n',' '),voice=voice,speed=speed,lang='en-gb',sentence_pause=.38,clause_pause=.14)
|
||||||
assert sample_rate==rate
|
assert sample_rate==rate
|
||||||
samples=np.asarray(samples,dtype=np.float32).reshape(-1)
|
samples=np.asarray(samples,dtype=np.float32).reshape(-1)
|
||||||
assert len(samples)>rate*.3 and np.isfinite(samples).all()
|
assert len(samples)>rate*.3 and np.isfinite(samples).all()
|
||||||
fade=min(240,len(samples)//4)
|
fade=min(240,len(samples)//4)
|
||||||
samples[:fade]*=np.linspace(0,1,fade);samples[-fade:]*=np.linspace(1,0,fade)
|
samples[:fade]*=np.linspace(0,1,fade);samples[-fade:]*=np.linspace(1,0,fade)
|
||||||
|
peak=float(np.max(np.abs(samples)));assert peak>.01
|
||||||
|
samples*=.86/peak
|
||||||
start=frames;pieces.append(samples);frames+=len(samples)
|
start=frames;pieces.append(samples);frames+=len(samples)
|
||||||
cues.append({'startMs':round(start*1000/rate),'endMs':round(frames*1000/rate),'text':part})
|
cues.append({'startMs':round(start*1000/rate),'endMs':round(frames*1000/rate),'text':part,'speaker':speaker})
|
||||||
pause=np.zeros(int(rate*.60),dtype=np.float32);pieces.append(pause);frames+=len(pause)
|
pause=np.zeros(int(rate*.60),dtype=np.float32);pieces.append(pause);frames+=len(pause)
|
||||||
audio=np.concatenate(pieces);peak=float(np.max(np.abs(audio)));assert peak>.01
|
audio=np.concatenate(pieces);peak=float(np.max(np.abs(audio)));assert peak>.01
|
||||||
audio*=.86/peak
|
assert peak<1
|
||||||
wav=source/'wav'/f"{record['resource']}.wav";flac=raw/f"{record['resource']}.flac"
|
wav=source/'wav'/f"{record['resource']}.wav";flac=raw/f"{record['resource']}.flac"
|
||||||
sf.write(wav,audio,rate,subtype='PCM_16')
|
sf.write(wav,audio,rate,subtype='PCM_16')
|
||||||
shutil.copyfile(wav,raw/wav.name)
|
shutil.copyfile(wav,raw/wav.name)
|
||||||
@@ -56,6 +77,11 @@ for record in json.loads((source/'scripts.json').read_text()):
|
|||||||
tracks[record['pageId']]={**record,'file':wav.name,'flacFile':flac.name,'wavSha256':hashlib.sha256(wav.read_bytes()).hexdigest(),'sampleRate':rate,'channels':1,'frames':len(audio),
|
tracks[record['pageId']]={**record,'file':wav.name,'flacFile':flac.name,'wavSha256':hashlib.sha256(wav.read_bytes()).hexdigest(),'sampleRate':rate,'channels':1,'frames':len(audio),
|
||||||
'durationMs':round(len(audio)*1000/rate),'textSha256':hashlib.sha256(record['text'].encode()).hexdigest(),
|
'durationMs':round(len(audio)*1000/rate),'textSha256':hashlib.sha256(record['text'].encode()).hexdigest(),
|
||||||
'flacSha256':hashlib.sha256(flac.read_bytes()).hexdigest(),'cues':cues}
|
'flacSha256':hashlib.sha256(flac.read_bytes()).hexdigest(),'cues':cues}
|
||||||
|
if a.append_continuations:
|
||||||
|
output,_=sf.read(wav,dtype='int16')
|
||||||
|
assert np.array_equal(output[:len(original)],original),'Original take changed while appending'
|
||||||
|
tracks[record['pageId']]['originalFrames']=len(original)
|
||||||
|
tracks[record['pageId']]['originalPcmSha256']=hashlib.sha256(original.tobytes()).hexdigest()
|
||||||
print(f"Saved {wav.name}: {len(audio)/rate:.1f}s; lossless FLAC verified",flush=True)
|
print(f"Saved {wav.name}: {len(audio)/rate:.1f}s; lossless FLAC verified",flush=True)
|
||||||
manifest={'voice':a.voice,'speed':a.speed,'language':'en-gb','method':'Synthetic narration rendered during development; bundled file playback only.',
|
manifest={'voice':a.voice,'speed':a.speed,'language':'en-gb','method':'Synthetic narration rendered during development; bundled file playback only.',
|
||||||
'speakers':{'Mara':{'voice':'bf_emma','speed':.82},'Narrator':{'voice':'bm_george','speed':.88}},
|
'speakers':{'Mara':{'voice':'bf_emma','speed':.82},'Narrator':{'voice':'bm_george','speed':.88}},
|
||||||
|
|||||||
@@ -0,0 +1,129 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:lumen/services/ambience.dart';
|
||||||
|
|
||||||
|
class _Output implements AmbienceOutput {
|
||||||
|
Soundscape? scene;
|
||||||
|
double gain = 0;
|
||||||
|
bool playing = false, disposed = false, fail = false;
|
||||||
|
Completer<void>? loading;
|
||||||
|
@override
|
||||||
|
Future<void> load(Soundscape value) async {
|
||||||
|
if (fail) throw StateError('No decoder');
|
||||||
|
await loading?.future;
|
||||||
|
scene = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> volume(double value) async => gain = value;
|
||||||
|
@override
|
||||||
|
Future<void> play() async => playing = true;
|
||||||
|
@override
|
||||||
|
Future<void> stop() async => playing = false;
|
||||||
|
@override
|
||||||
|
Future<void> dispose() async => disposed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
test('bridge, harbour and tower have their own atmosphere', () {
|
||||||
|
expect(soundscapeFor(6), Soundscape.bridge);
|
||||||
|
for (final i in [4, 5, 7]) {
|
||||||
|
expect(soundscapeFor(i), Soundscape.harbour);
|
||||||
|
}
|
||||||
|
for (final i in [8, 9, 10]) {
|
||||||
|
expect(soundscapeFor(i), Soundscape.tower);
|
||||||
|
}
|
||||||
|
expect(soundscapeFor(0), Soundscape.cottage);
|
||||||
|
expect(soundscapeFor(11), Soundscape.cottage);
|
||||||
|
});
|
||||||
|
test(
|
||||||
|
'voice ducks atmosphere, pause restores it, mute and background stop it',
|
||||||
|
() async {
|
||||||
|
final output = _Output();
|
||||||
|
final ambience = Ambience(output: output);
|
||||||
|
void update({
|
||||||
|
bool voice = false,
|
||||||
|
bool enabled = true,
|
||||||
|
bool foreground = true,
|
||||||
|
}) => ambience.update(
|
||||||
|
scene: Soundscape.bridge,
|
||||||
|
enabled: enabled,
|
||||||
|
foreground: foreground,
|
||||||
|
narrating: voice,
|
||||||
|
volume: .7,
|
||||||
|
);
|
||||||
|
update();
|
||||||
|
await ambience.settled;
|
||||||
|
expect(output.playing, true);
|
||||||
|
expect(output.gain, closeTo(.28, .0001));
|
||||||
|
update(voice: true);
|
||||||
|
await ambience.settled;
|
||||||
|
expect(output.gain, closeTo(.07, .0001));
|
||||||
|
update();
|
||||||
|
await ambience.settled;
|
||||||
|
expect(output.gain, closeTo(.28, .0001));
|
||||||
|
update(enabled: false);
|
||||||
|
await ambience.settled;
|
||||||
|
expect(output.playing, false);
|
||||||
|
update();
|
||||||
|
await ambience.settled;
|
||||||
|
update(foreground: false);
|
||||||
|
await ambience.settled;
|
||||||
|
expect(output.playing, false);
|
||||||
|
ambience.dispose();
|
||||||
|
await Future<void>.delayed(Duration.zero);
|
||||||
|
expect(output.disposed, true);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
test('a mute while loading cannot start a stale sound', () async {
|
||||||
|
final output = _Output()..loading = Completer<void>();
|
||||||
|
final ambience = Ambience(output: output);
|
||||||
|
ambience.update(
|
||||||
|
scene: Soundscape.bridge,
|
||||||
|
enabled: true,
|
||||||
|
foreground: true,
|
||||||
|
narrating: false,
|
||||||
|
volume: 1,
|
||||||
|
);
|
||||||
|
await Future<void>.delayed(Duration.zero);
|
||||||
|
ambience.update(
|
||||||
|
scene: Soundscape.bridge,
|
||||||
|
enabled: false,
|
||||||
|
foreground: true,
|
||||||
|
narrating: false,
|
||||||
|
volume: 1,
|
||||||
|
);
|
||||||
|
output.loading!.complete();
|
||||||
|
await ambience.settled;
|
||||||
|
expect(output.playing, false);
|
||||||
|
expect(output.gain, 0);
|
||||||
|
ambience.dispose();
|
||||||
|
});
|
||||||
|
test(
|
||||||
|
'failed atmosphere stays isolated and can recover after toggling',
|
||||||
|
() async {
|
||||||
|
final output = _Output()..fail = true;
|
||||||
|
final ambience = Ambience(output: output);
|
||||||
|
void update(bool enabled) => ambience.update(
|
||||||
|
scene: Soundscape.bridge,
|
||||||
|
enabled: enabled,
|
||||||
|
foreground: true,
|
||||||
|
narrating: false,
|
||||||
|
volume: .5,
|
||||||
|
);
|
||||||
|
update(true);
|
||||||
|
await ambience.settled;
|
||||||
|
expect(ambience.error, isNotEmpty);
|
||||||
|
expect(output.playing, false);
|
||||||
|
update(false);
|
||||||
|
await ambience.settled;
|
||||||
|
output.fail = false;
|
||||||
|
update(true);
|
||||||
|
await ambience.settled;
|
||||||
|
expect(ambience.error, isEmpty);
|
||||||
|
expect(output.playing, true);
|
||||||
|
ambience.dispose();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user