c2527a0a66
Context:
The Freenove plays a screen+buttons "livre dont vous etes le heros".
The PLIP retro phone has no screen, so we want a phone-native version:
an audio choose-your-own-adventure where the narrator reads the passage
and its numbered choices, and the player dials a digit to choose.
Approach:
A self-contained plip_gamebook module reads a phone audio pack from the
SD (narration WAVs already include the spoken "faites le N" prompts),
plays passages through the earpiece, and maps each dialed digit to a
choice. It hooks into the existing conversation state machine and the
existing dialer (rotary/DTMF) — fully offline, no model, no network.
Changes:
- New plip_gamebook.c/.h: loads /sdcard/gamebook/{library.json,
menu.wav, <id>.json, <id>_<passage>.wav}; pickup plays the story
menu, digit picks a story, then each passage plays its WAV and a
dialed digit jumps to that choice; an ending + any digit returns to
the menu. Interrupts narration so a dial is instant.
- conversation.c: new STATE_GAMEBOOK; off-hook from idle launches the
gamebook when a pack is on the SD (else the normal dialtone/NPC flow,
so the phone still works without a pack); each dialed digit is fed to
the gamebook; go_idle() tears it down on hang-up.
- CMakeLists: build plip_gamebook.c.
Impact:
With a phone pack staged on its SD, the PLIP becomes an audio gamebook:
pick up, dial to choose your story and your path, hang up to stop.
Non-breaking when no pack is present. Builds clean.
34 lines
607 B
CMake
34 lines
607 B
CMake
idf_component_register(
|
|
SRCS
|
|
"main.c"
|
|
"es8388.c"
|
|
"audio.c"
|
|
"net.c"
|
|
"cmd_exec.c"
|
|
"hook_client.c"
|
|
"phone.c"
|
|
"tones.c"
|
|
"dialer.c"
|
|
"conversation.c"
|
|
"dtmf.c"
|
|
"turn_client.c"
|
|
"slic.c"
|
|
"plip_gamebook.c"
|
|
INCLUDE_DIRS "."
|
|
PRIV_REQUIRES
|
|
driver
|
|
esp_driver_gpio
|
|
esp_event
|
|
esp_http_client
|
|
esp_http_server
|
|
esp_netif
|
|
esp_timer
|
|
esp_wifi
|
|
json
|
|
nvs_flash
|
|
spiffs
|
|
fatfs
|
|
sdmmc
|
|
scenario_mesh
|
|
)
|