AnyBot/src/app
王性驊 40d1d9707a Voice: its own 設定 › 語音, run by the brain for every screen and the phone
Voice was three implementations that broke on their own: speech to text
borrowed the OpenAI key (so with only Grok set up the mic recorded,
then failed), OpenAI's models it hard-coded stop on 2027-02-26, read
aloud was macOS `say` or espeak-ng (silently nothing on Windows, where
espeak isn't installed), and the phone used the browser's own
recognition. Now:

- 設定 › 語音 has 聽 and 說, each a service: off, OpenAI-compatible
  (OpenAI, Groq, a Whisper server of your own: the address decides),
  xAI or ElevenLabs. An empty key borrows 設定 › 模型's for the same
  service. Each side says 可以用 or what it lacks; 聽 has 試試看
  (record a sentence, show what was heard), 說 has 試聽 and the voice
  list. speech.rs does the calls; xAI's both ways were checked for real
  (Mandarin read, then heard back, in Traditional characters).
- The brain does it all: the phone POSTs its recording (MediaRecorder)
  to /api/voice/transcribe, screens to /api/sync/voice/transcribe;
  answers come back as MP3 from …/voice/speech and are played on the
  device (rodio; an <audio> on the phone, 「唸出來」 in a message's
  menu). Keys stay on the brain (the voice keys are redacted for
  screens like the others).
- No service, no voice anywhere: the mic, 語音聊天, 會議錄音 and 朗讀
  only appear once 聽 (and 說) can be called; the phone's state says
  which. Without voice the send arrow just rests where 語音聊天 was.
- 會議錄音 is uploaded to the brain, which turns it into text in the
  background and hands it to the bot itself: a meeting is longer than
  the 35 s the account lets a request wait, and a brain on a server has
  no window (the jobs are polled in background()).
- Recognisers answer Mandarin in Simplified: in a Traditional Chinese
  window or phone the text becomes Traditional with Taiwan wording.
- Older saves: whoever had an OpenAI key keeps voice input (聽 =
  OpenAI); everyone else starts with it off. Bots' macOS voice names
  are cleared. 對話詳細資訊's 加入會議 started plain voice input; it
  starts a meeting now.
2026-11-10 22:58:18 +08:00
..
attach_ui.rs Voice: its own 設定 › 語音, run by the brain for every screen and the phone 2026-11-10 22:58:18 +08:00
channels_ui.rs Bug sweep: gates, relay 2FA, Windows input, snapshots, encodings 2026-11-10 11:46:17 +08:00
chat_ui.rs Chat: a 回到底部 button once you've scrolled far up 2026-11-10 22:00:34 +08:00
computers_ui.rs Bug sweep: gates, relay 2FA, Windows input, snapshots, encodings 2026-11-10 11:46:17 +08:00
files_ui.rs Bug sweep: gates, relay 2FA, Windows input, snapshots, encodings 2026-11-10 11:46:17 +08:00
markdown_ui.rs Bug sweep: gates, relay 2FA, Windows input, snapshots, encodings 2026-11-10 11:46:17 +08:00
menu_ui.rs Rewrite decompilation comments as behaviour specs; move reverse-engineering docs out of the repo; drop third-party marks from UI strings (i18n tables synced) 2026-11-09 16:37:33 +08:00
mirror_ui.rs Voice: its own 設定 › 語音, run by the brain for every screen and the phone 2026-11-10 22:58:18 +08:00
pages_ui.rs 頁面: pages a bot makes and keeps up to date (like the original's tracking pages) 2026-11-05 01:41:41 +08:00
panel_ui.rs Voice: its own 設定 › 語音, run by the brain for every screen and the phone 2026-11-10 22:58:18 +08:00
remote_ui.rs Voice: its own 設定 › 語音, run by the brain for every screen and the phone 2026-11-10 22:58:18 +08:00
sidebar_ui.rs Rewrite decompilation comments as behaviour specs; move reverse-engineering docs out of the repo; drop third-party marks from UI strings (i18n tables synced) 2026-11-09 16:37:33 +08:00
vault_ui.rs Clippy is clean on macOS and Linux, for the app and the relay 2026-11-07 10:10:28 +08:00
voice_ui.rs Voice: its own 設定 › 語音, run by the brain for every screen and the phone 2026-11-10 22:58:18 +08:00
welcome_ui.rs First start: no bots, a guide instead; signing in syncs this computer and the account 2026-11-05 14:25:01 +08:00