現場實錄 —— 即時中英語音翻譯IBA「Train the Trainer」課堂 · 高雄
選好兩種語言按下開始:左欄原文、右欄譯文;譯音可以隨時關掉,文字翻譯不中斷。
麥克風 PCM 由瀏覽器直連 Gemini Live;Worker 只簽短效 token。逐字稿與音訊不落地,重新整理即消失。
PiP 浮動字幕疊在任何 App 上;每十分鐘更新一份累積 Markdown 摘要,長對話也不迷路。
The expensive, long-running part — audio — never touches the server. The browser streams straight to Gemini Live; Cloudflare only signs tokens and writes summaries.
16kHz
mic in
24kHz
speech out
60s
token deadline
~6s
reconnect buffer
10min
summary cadence
Microphone
16 kHz PCM · AudioWorklet
Gemini Live
direct WebSocket — no proxy
Transcripts + 24 kHz speech
scheduled, gapless playback
Cloudflare Worker never touches the audio — it signs single-use 60-second tokens and writes a cumulative summary every ten minutes.
Microphone PCM streams from the browser to Gemini Live over WebSocket. The Worker issues the token but never proxies a single audio frame.
Each ephemeral token works once, must start a session within 60 seconds, and locks the model and target language server-side.
OpenCC converts Simplified to Taiwan Traditional lazily, appending only the new delta so re-conversion never duplicates text; sentences break on 。!? and .?!
Transcripts, audio and summaries live only in page memory. Refresh clears everything; localStorage keeps just UI preferences.