← Ziding Zhang

Bilingual voice stream: a silent cartographer prototype

A zero-audio bilingual Mandarin-English storytelling prototype and 45-minute A/B trial kit that keeps family talk human while logging structured memory cues.

November 29, 2026 · Project · What is not yet established


The design constraint doing the work

Two earlier notes set the floor rules for family memory capture: interruptions break private retrieval order (How conversations unlock stories), and speaking assistants hijack intimate rooms into triadic performance (Silent cartographer, whispered cues, building on Porcheron et al., CHI 2018 and Weiser & Brown, 1996). To test those rules in real bilingual Mandarin-English talk, I built a runnable prototype that enforces a hard 0 dB client mute sink, preserves >= 2s memory-search pauses, and throttles host-only peripheral anchors to at most one cue per 75 seconds.

Three-stage pipeline diagram: Host and Parent speak code-switched Mandarin and English across one sparse photo into a Gemini Live API stream with a hard 0 dB client mute sink and 75-second dwell gate, emitting one bare host-only whisper anchor plus local JSONL event logs and A/B scorecard metrics.
A zero-audio streaming loop built on the Gemini Live API: audio flows in, spoken bot turns never leave the client, and only one calm anchor reaches the host. Replay the bilingual stream or run a local 45-minute trial →

Try the workbench or run the kit locally

The interactive storytelling workbench lets anyone step through an anonymized 12-turn Mandarin-English session—flipping between Silent Cartographer and Interrupting Co-Host—or launch a zero-backend 45-minute A/B timer, local .webm recorder, and JSON scorecard that never leaves the browser.

For live streaming and reproducible evaluation, the Python PoC kit (session_runner.py) ships with a zero-key --demo harness and a --live runner wired to the current google-genai SDK. On the synthetic 5.75-minute fixture (11/12 diarization accuracy, 10/12 code-switched turns, 38 intra-turn switches, 19 concrete episodic details), the deterministic check highlights the exact trade-off to test in real rooms:

Mode (synthetic 5.75m)Audio>= 2s pauses brokenCues / interruptions
Silent Cartographer0 dB0 / 103 cues (2 held by 75s gate)
Counterfactual Co-HostAudible6 / 10 (60%)6 spoken interjections

Real proof requires human rooms, not synthetic logs. That is why the kit centers on a counterbalanced 45-minute A/B protocol: 15 minutes of bare oral-history questions (Block A) versus 15 minutes with sparse artifacts from the artifact–story flywheel plus the 0 dB whisper rail (Block B), scored on episodic details per minute, newly resolved dates/entities, and blinded 1–5 Guest comfort.

Agent context: sources, method and working notes

Technical architecture (current google-genai SDK)

The live runner in /research/bilingual-storytelling-stream/session_runner.py uses the current google-genai Python SDK (>= 2.3.0; never legacy google-generativeai) over v1beta WebSockets and exposes two engines for streaming 16 kHz, 16-bit signed mono PCM audio in 100 ms chunks (audio/pcm;rate=16000):

  1. --engine live-agent (gemini-3.8-live, default):
    • Connects via client.aio.live.connect(model="gemini-3.8-live", config=types.LiveConnectConfig(...)).
    • Declares two asynchronous NON_BLOCKING function tools (log_diarized_turn and emit_whisper_cue) and answers every incoming tool_call via session.send_tool_response so audio ingestion never stalls.
    • Enables input_audio_transcription=types.AudioTranscriptionConfig(custom_vocabulary=...) for family place/name biasing, context_window_compression=types.ContextWindowCompressionConfig(sliding_window=types.SlidingWindow()) for sessions longer than 15 minutes, and session_resumption=types.SessionResumptionConfig(handle=...) with go_away logging to survive ~10-minute WebSocket resets.
    • Hard 0 dB client audio sink: Because gemini-3.8-live uses response_modalities=[types.Modality.AUDIO], the client deliberately opens no audio output stream and drops all part.inline_data audio frames at the boundary—guaranteeing zero unsolicited room speech even if the model attempts a spoken reply.
  2. --engine transcribe (gemini-3.5-transcribe-live):
    • Uses response_modalities=["TEXT"] with input_audio_transcription=types.AudioTranscriptionConfig(language_codes=[]) for automatic bilingual code-switch detection.
    • Streams interim_input_transcription (hidden by default unless --show-interim is passed, preventing screen-magnet gaze theft) and finalized input_transcription, sending audio_stream_end=True on turn/stream end and routing finalized text through the local deterministic CJK/Latin code-switch splitter, entity/gap extractor, and 75-second WhisperCueState dwell gate.

Public PoC bundle & exact reproduction

All sanitized files live under /research/bilingual-storytelling-stream/:

  • README.md: setup, privacy boundary, and full 45-minute counterbalanced A/B protocol.
  • session_runner.py: zero-dependency --demo evaluator and google-genai --live runner (mic via optional sounddevice or pre-recorded 16 kHz mono WAV via --wav).
  • sample_session.jsonl: anonymized 12-turn (5.75 min) Mandarin-English fixture (Host + Parent, synthetic Cedar Street / River Road scenario).
  • demo_output/session_events.jsonl and demo_output/scorecard.json: verified outputs from running python3 public/research/bilingual-storytelling-stream/session_runner.py --demo.

To reproduce --demo with zero API keys:

python3 public/research/bilingual-storytelling-stream/session_runner.py --demo

Verified --demo outputs (demo_output/scorecard.json): 12 turns (345.0s / 5.75 min), 11/12 (91.7%) speaker accuracy (one intentional short overlapping backchannel confusion at T05), 2.47x Parent-to-Host floor ratio, 10/12 (83.3%) mixed zh+en turns with 38 intra-turn switches (435 CJK chars, 57 Latin words), 19 concrete episodic details (3.3/min), 36 unique entities tagged, 7 open gaps surfaced, 0 spoken interruptions across 10 long (>= 2s) pauses, 3 peripheral cues emitted (T02, T06, T10), 2 redundant candidates suppressed by the 75s dwell gate, vs. 6 counterfactual Co-Host interruptions (60.0% of long pauses broken).

Experimental rubric & falsification boundary

  • Counterbalanced 45-minute schedule: 00–05m explicit verbal consent & visible mute latch → 05–20m Block A (bare oral-history questions, no photos, no rail) → 20–25m paused tea/water reset → 25–40m Block B (2–3 sparse undated artifacts + Silent Cartographer 0 dB rail, max 1 anchor, >= 75s dwell) → 40–45m blinded 1–5 Guest and Host comfort rating before inspecting transcripts, plus one open check on surveillance/interview feel. Odd pairs run A → B; even pairs run B → A.
  • Scoring metrics: (1) concrete episodic details/min (sensory anchors, physical objects, causal micro-events; excluding generic summaries); (2) newly resolved entities, dates, and orphan artifacts; (3) floor preservation (Parent:Host ratio, >= 2s pauses unbroken, Host gaze breaks per 5 min); (4) separate 1–5 Guest and Host comfort scores.
  • Explicit falsification rule: If Block B drops Guest comfort by >= 1 point relative to Block A—even while raising episodic details/min—the live peripheral whisper rail fails calm presence and must be demoted to post-session review only.
  • Honest simulation boundary: No real family audio, personal addresses, or live human trial measurements appear anywhere in this prototype. Everything in --demo and the browser replay mode is an anonymized synthetic testbed built to exercise the pipeline and let readers run real trials privately in their own homes.

Primary sources & visual artifacts

  • Gemini Live API documentation — bidirectional WebSocket audio streaming, NON_BLOCKING function calling, context window compression, session resumption, and live transcription (gemini-3.8-live and gemini-3.5-transcribe-live).
  • Martin Porcheron, Joel E. Fischer, Stuart Reeves & Sarah Sharples (2018), “Voice Interfaces in Everyday Life”, Proceedings of CHI ‘18, DOI: 10.1145/3173574.3174214.
  • Mark Weiser & John Seely Brown (1996 / 1997), “The Coming Age of Calm Technology”, DOI: 10.1007/978-1-4612-0685-9_6.
  • Static architecture diagram: /images/poc-bilingual-storytelling-stream/bilingual-pipeline.svg (960 × 580, broadsheet palette #FAF9F5 / #F3F1EA / #141413 / #6B6A64 / #BA6348 / #3D5A6C / #4A6B53).
  • Interactive plain-first workbench: /interactive/bilingual-storytelling-stream/ (all 12 bilingual turns, code-switch highlights, whisper cues, counterfactual co-host interruptions, and A/B protocol rendered in static HTML; JavaScript progressively adds replay controls, local 45-min countdown clock, optional client-side Web Audio waveform + .webm recorder, and local JSON export).

Have an answer, a counterexample, or a story? See Talk to me for open questions and live trials.

Credits: Ziding Zhang, with Gemini for the Python runner, browser workbench, vector diagram, and A/B protocol; builds on the Gemini Live API, Weiser & Brown (1996), and Porcheron et al. (CHI 2018).