Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

feat: switch AI Service to OpenRouter, ZenMux, OpenAI or any OpenAI-compatible service when Ling isn't an option

wqugurue77422009e1b
diff --git a/AGENTS.md b/AGENTS.md
index b7bafe5..f88c945 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -10,8 +10,8 @@ Cicada (知了, formerly Live Subs) turns what a computer plays into live transl
## Hard rules
-- The Ling key lives only in the 0600 `ling-api-key` file (`AIKey`): never UserDefaults, logs or exports.
-- Every Ling call goes through `LingClient` (rate gate, priorities, `thinking: disabled`, content in the system message). Partial text is translated by Google, never Ling.
+- AI keys live only in 0600 files (`AIKey`): never UserDefaults, logs or exports.
+- Every AI call goes through `LingClient` (rate gate, priorities, `thinking: disabled`, content in the system message). Partial text is translated by Google, never Ling.
- Never speak untranslated text into the room. Never bundle the GPL BlackHole driver; download it and check its pinned SHA-256.
- The notes window is a non-activating panel with `sharingType = .none`: it must never take focus, and stays out of screen captures unless the user turns on 共享屏幕时让对方看到 (then it shows a badge).
- Mac: UI and engine state are `@MainActor`; audio callbacks hand buffers to `AudioRouter`'s queue.
diff --git a/README.en.md b/README.en.md
index 102fdf2..57ac384 100644
--- a/README.en.md
+++ b/README.en.md
@@ -101,6 +101,8 @@ Without a Ling key, everything runs on Apple's on-device models plus Google Tran
3. In Cicada, open **Settings › AI Service**, paste the key, and click **Save and check** (or paste it in the prompt at the top of the notes window). A one-token request confirms it works.
4. Optionally pick the model (`Ling-3.1-flash` by default) on the same page, and the Ming voice for each language under **Settings › Interpreting**. To remove the key, click **Remove** on the same page.
+If you can't sign up for Ling, switch to OpenRouter, ZenMux or OpenAI from the menu at the top right of **Settings › AI Service**, or enter the address of any OpenAI-compatible service (a model running on your Mac, for example). Live notes and sentence translation work with all of them, with models picked for quality and price that you can change; OpenRouter and ZenMux also give interpreting natural Gemini voices. One-step voice translation and voice cloning are Ling only; with other services, interpreting recognizes on your Mac and then translates. Each service keeps its own key, so switching back needs no re-entry.
+
## Requirements & Installation
Requires **macOS 14.4 or later** on **Apple silicon**. macOS 26 uses the newer on-device speech recognizer, which is more accurate; on 14.4–15 Cicada uses the system's earlier recognizer, which needs **Dictation** turned on in **System Settings › Keyboard**, with each language you want heard added to its languages. The UI is available in English, Chinese, Japanese, and Korean, following your macOS language or set per app in **System Settings › General › Language & Region**.
@@ -120,7 +122,7 @@ In rough order; tell us what you need in Issues.
- **Recording what you say**, listening to your microphone during meetings with echo cancellation so your own proposals and to-dos are included in the transcript and notes.
- **Developer ID signing and notarization**, removing the "Open Anyway" prompt on first launch and storing the AI key in the macOS Keychain.
- **Speaker recognition**, building on today's speaker identification to remember frequent meeting participants by voice on your Mac, so they're named in the next meeting too.
-- **Local notes without an API key** using Apple's on-device model on supported Macs, plus **custom AI providers** for any OpenAI-compatible endpoint.
+- **Local notes without an API key** using Apple's on-device model on supported Macs.
- **Windows and Android**, sharing the same notes and meeting-record formats (iPhone and iPad are not planned due to iOS audio capture restrictions).
See [docs/ROADMAP.md](docs/ROADMAP.md) for details and trade-offs on each item.
diff --git a/README.md b/README.md
index b39951e..188957d 100644
--- a/README.md
+++ b/README.md
@@ -100,6 +100,8 @@
3. 在知了里打开设置里的 AI 服务,粘贴后点保存并检查,也可以直接粘贴到纪要窗口顶部的提示框里。知了会发一个只用一个 token 的请求确认 key 可用。
4. 同一页面可以选模型(默认 `Ling-3.1-flash`),每种语言用哪个 Ming 声音在同声传译设置里选。想移除 key,在同一页面点移除即可。
+注册不了 Ling 时,可以在“设置 › AI 服务”右上角换成 OpenRouter、ZenMux、OpenAI,或填任何 OpenAI 兼容服务的地址(比如本机跑的模型)。实时纪要和整句翻译都能用,模型已经按效果和价格选好,也可以自己换;OpenRouter 和 ZenMux 还能用 Gemini 的自然人声做同传。一步语音翻译和声音克隆只有 Ling 有,其他服务下同传先在本机识别再翻译。每个服务的 key 各存一份,切换时不用重填。
+
## 系统要求与安装
需要 macOS 14.4 或更新版本、Apple 芯片的 Mac。macOS 26 上用新的本机语音识别,更准;14.4–15 上用系统较早的识别,要在系统设置 › 键盘里打开“听写”,并把要听的语言加进听写语言。界面有中文、英文、日文和韩文,默认跟随系统语言,也可以在系统设置的语言与地区里单独给知了指定。
@@ -119,7 +121,7 @@
- **记录我的发言**,开会时持续听麦克风并做回声消除,把你直接开口说的话也记进文字记录和纪要。
- **正式签名与公证**,首次打开不再需要点仍要打开,AI key 也能放回系统钥匙串。
- **声纹识别**,在现有的说话人识别基础上,在本机记住常一起开会的人的声音,下次开会也能自动认出。
-- **不用 key 也有纪要**,在支持的 Mac 上用 Apple 本机模型整理纪要,以及**自选 AI 服务**接入其他兼容 OpenAI 接口的服务。
+- **不用 key 也有纪要**,在支持的 Mac 上用 Apple 本机模型整理纪要。
- **Windows 和 Android**,共用纪要与会议记录格式,iPhone 和 iPad 因系统限制暂不计划。
每项的细节和取舍见 [docs/ROADMAP.zh-CN.md](docs/ROADMAP.zh-CN.md)。
diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings
index bc556b0..23e860f 100644
--- a/Resources/en.lproj/Localizable.strings
+++ b/Resources/en.lproj/Localizable.strings
@@ -1,40 +1,85 @@
+/* AIProviders */
+"更准" = "More accurate";
+"更快、更省" = "Faster, cheaper";
+"女" = "Female";
+"男" = "Male";
+"和 Ling 同款" = "Same as Ling";
+"中文好" = "Great at Chinese";
+"效果和价格最均衡" = "Best balance of quality and price";
+"更省" = "Cheaper";
+"够用、更省" = "Good enough, cheaper";
+"自定义服务" = "Custom service";
+
/* AISettings */
-"用在哪里" = "Where it's used";
-"一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。" = "About ¥0.15–1 per hour of meeting (current discount pricing). Only text is sent (plus your voice sample if you use your own voice); speech recognition stays on this Mac.";
+"其他(兼容 OpenAI)" = "Other (OpenAI-compatible)";
+"现在能用的" = "What works now";
+"用 %@" = "Uses %@";
"实时纪要" = "Live notes";
-"用 Ling" = "Ling";
"需要 key" = "Needs key";
"会中每 45 秒更新" = "Updated every 45 s during a meeting";
"填好 key 后可用" = "Available once a key is set";
"翻译" = "Translation";
-"整句用 Ling;不行时换 Google、本机" = "Full sentences use Ling; falls back to Google, then on-device";
-"整句用 Ling;不行时换 Google" = "Full sentences use Ling; falls back to Google";
+"整句用它;不行时换 Google、本机" = "Used for full sentences; falls back to Google, then on-device";
+"整句用它;不行时换 Google" = "Used for full sentences; falls back to Google";
"没有 key 时照常可用" = "Works without a key";
-"语音识别" = "Speech recognition";
+"同传声音" = "Interpreting voice";
"本机" = "On-device";
+"你自己的声音" = "Your own voice";
+"录一段,让对方听到你的音色" = "Record a sample so others hear your voice";
+"只有 Ling" = "Ling only";
+"换用 Ling 才有" = "Switch to Ling to use";
+"语音识别" = "Speech recognition";
"更快,不花钱" = "Faster, and free";
-"同声传译的声音" = "Interpreting voice";
-"Ming 的声音或你自己的声音" = "A Ming voice or your own voice";
-"没有 key 时用本机声音" = "Uses the Mac's voice without a key";
-"去选声音" = "Choose voice";
+"自己选模型" = "Choose models yourself";
"模型" = "Model";
"3.1 更准;3.0 更快、更省" = "3.1 is more accurate; 3.0 is faster and cheaper";
-"在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。" = "On the Ling platform, click “Create token” and copy the string that starts with sk-.";
-"打开 Ling 开放平台 ↗" = "Open the Ling platform ↗";
+"文字模型" = "Text model";
+"纪要和整句翻译" = "Notes and sentence translation";
+"声音模型" = "Voice model";
+"同传念给对方" = "Speaks to the room when interpreting";
+"一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。" = "About ¥0.15–1 per hour of meeting (current discount pricing). Only text is sent (plus your voice sample if you use your own voice); speech recognition stays on this Mac.";
+"按所选模型计费。发出去的只有文字,语音识别留在本机。" = "Billed by chosen model. Only text is sent; speech recognition stays on-device.";
+"在 %@ 创建 key,复制后粘贴到这里。" = "Create a key on %@, then copy and paste it here.";
+"打开 %@ ↗" = "Open %@ ↗";
+"还没填好" = "Incomplete";
"还没填 API key" = "No API key yet";
"正在检查…" = "Checking…";
"已连接" = "Connected";
"这个 key 用不了" = "This key doesn't work";
"暂时连不上" = "Can't connect right now";
"%@ · 响应约 %@ 秒" = "%1$@ · responds in about %2$@ s";
-"Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个" = "Ling says this token is invalid. Check that you copied all of it, or create a new one";
+"%@ 提示 key 无效,请检查是否复制完整,或重新创建一个" = "%@ says the key is invalid. Check if it's copied completely, or create a new one.";
"不填 key 时,字幕和翻译仍可正常使用" = "Subtitles and translation work without a key";
"更换" = "Change";
"重试" = "Retry";
"保存并检查" = "Save and check";
"取消" = "Cancel";
-"只存在这台 Mac 上(只有你的账户能读),只发给 Ling(ant-ling.com)" = "Stored only on this Mac, sent only to Ling (ant-ling.com)";
+"本机服务可不填" = "Optional for local services";
"移除" = "Remove";
+"只存在这台 Mac 上(只有你的账户能读),只发给 %@" = "Stored only on this Mac (readable only by your account) and sent only to %@";
+"只存在这台 Mac 上(只有你的账户能读),只发给 %@(%@)" = "Stored only on this Mac (readable only by your account) and sent only to %@ (%@)";
+"地址需用 https,仅 localhost 可用 http。" = "URL must use https. http is only allowed for localhost.";
+"地址" = "URL";
+"例如 qwen3:14b" = "e.g. qwen3:14b";
+"你填的地址" = "the URL you entered";
+"Ming 的声音" = "Ming's voice";
+"没有 key 时用本机声音" = "Uses the Mac's voice without a key";
+"没填声音模型,用本机声音" = "No voice model set; using on-device voice";
+"%@ 暂不能出声音,用本机声音" = "%@ doesn't support voice yet; using on-device voice";
+"声音(可选)" = "Voice (optional)";
+"需支持 /audio/speech;不填则用本机声音。" = "Needs /audio/speech; leave blank to use the on-device voice.";
+"例如 kokoro" = "e.g. kokoro";
+"声音" = "Voice";
+"例如 af_heart" = "e.g. af_heart";
+"跟上面一样" = "Same as above";
+"(推荐)" = "(Recommended)";
+"模型名" = "Model name";
+"好" = "OK";
+"推荐" = "Recommended";
+"全部 %lld 个" = "All %lld";
+"填其他模型名…" = "Enter another model name…";
+"其他" = "Other";
+"选一个" = "Choose one";
/* AboutPanel */
"把 Mac 正在播放的声音变成实时双语字幕和会议纪要" = "Live bilingual subtitles and meeting notes from whatever your Mac is playing";
@@ -228,7 +273,11 @@
"会议原文" = "Meeting's own";
/* Ling */
-"连不上 Ling,检查网络或代理" = "Can't reach Ling; check your network or proxy";
+"这个服务" = "this service";
+"找不到模型,或地址不对(HTTP %lld)" = "Model not found, or wrong URL (HTTP %lld)";
+"%@ 拒绝了请求(HTTP %lld),请检查模型名" = "%@ rejected the request (HTTP %lld). Check the model name.";
+"连不上 %@,请检查网络或代理" = "Can't connect to %@. Check your network or proxy.";
+"这个服务不支持 JSON(HTTP %lld),纪要用不了" = "This service doesn't support JSON (HTTP %lld), so notes won't work";
/* ListenEngine */
"%@(识别中…)→ %@" = "%1$@ (detecting…) → %2$@";
@@ -236,6 +285,7 @@
"等你允许使用麦克风" = "Waiting for microphone access";
"正在听" = "Listening";
"此 Mac 不支持本机语音识别" = "This Mac doesn't support on-device speech recognition";
+"请在系统设置里允许“系统音频录制”,再重新打开知了" = "Allow System Audio Recording in System Settings, then reopen Cicada";
"无法读取系统音频,请在系统设置里允许“系统音频录制”" = "Can't read system audio. Allow “System Audio Recording” in System Settings";
"没能下载 %@ 语音模型" = "Couldn't download the %@ speech model";
"已暂停" = "Paused";
@@ -333,12 +383,13 @@
"%lld 分钟前更新" = "Updated %lld min ago";
"这场会议的语言" = "Languages for this meeting";
"整理中" = "Updating";
+"共享屏幕时让对方看到" = "Show when sharing screen";
"对方可见" = "Visible to others";
"仅自己可见" = "Only you";
-"对方可见 · 点击关闭" = "Visible to others · Click to hide";
-"仅自己可见 · 点击共享" = "Only you · Click to share";
"文字记录 · %lld" = "Transcript · %lld";
"文字记录" = "Transcript";
+"对方可见 · 点击关闭" = "Visible to others · Click to hide";
+"仅自己可见 · 点击共享" = "Only you · Click to share";
"在文字记录中搜索 ⌘F" = "Search transcript ⌘F";
"无结果" = "No results";
"上一个" = "Previous";
@@ -365,8 +416,8 @@
"开始新会议" = "New Meeting";
"更换 key" = "Change Key";
"生成纪要需要 API key" = "Notes need an API key";
-"文字记录仍在正常保存。填入 Ling 的 key 后,会从头开始整理整场会议的内容。" = "The transcript is still being saved. Once you add a Ling key, notes are written for the whole meeting from the start.";
-"获取 Ling key ↗" = "Get a Ling key ↗";
+"文字记录仍在保存。填好 %@ 的 key 后,会从头整理出整场纪要。" = "Transcript is still being saved. Enter a %@ key to generate notes from the beginning.";
+"获取 %@ key ↗" = "Get %@ key ↗";
"保存并开始" = "Save and Start";
"没有进行中的会议" = "No meeting in progress";
"这场会议还没有纪要" = "No notes for this meeting yet";
@@ -408,11 +459,13 @@
"字幕和纪要都从这里来。去系统设置打开,回来会自动识别。" = "Subtitles and notes come from it. Turn it on in System Settings; Cicada notices when you're back.";
"声音只在本机识别" = "Audio is recognized only on this Mac";
"听电脑里的声音" = "Hear the Mac's audio";
+"在系统设置里打开后,要重新打开知了" = "After turning it on in System Settings, reopen Cicada";
"只听声音,不录屏幕画面" = "Sound only, never the screen";
"识别语音" = "Recognize speech";
"打开“听写”,允许“语音识别”" = "Turn on Dictation and allow Speech Recognition";
"已打开" = "On";
"去开启" = "Turn On";
+"重新打开" = "Reopen";
"放一段会议试试" = "Try a meeting";
"一段 9 秒的英文会议,字幕会跟着声音实时出来。" = "A 9-second meeting in English. Subtitles appear as they talk.";
"听到" = "Hearing";
@@ -449,21 +502,31 @@
"下一步接上 Ling 就有" = "Connect Ling in the next step";
/* OnboardingKey */
-"接上 Ling,用上完整的知了" = "Connect Ling to get all of Cicada";
-"纪要、更准的翻译和自然的同传语音都靠它,约 1 分钟。" = "Notes, sharper translation and natural interpreting voices all run on it. Takes about a minute.";
+"用其他服务" = "Use another service";
+"纪要和翻译都能用,模型已经选好。" = "Notes and translation are ready; models are preselected.";
+"接上 Ling,一个 key 用上全部功能" = "Connect Ling to unlock all features with one key";
+"更准的翻译" = "Sharper translation";
+"自然的同传声音" = "Natural interpreting voice";
+"用你自己的声音" = "Use your own voice";
"Ling 每月赠送 ¥10 额度" = "Ling gives ¥10 of credit every month";
"约够 10–50 小时会议" = "Enough for about 10–50 hours of meetings";
+"‹ 还是用 Ling" = "‹ Use Ling instead";
+"用不了 Ling?" = "Can't use Ling?";
+"粘贴 %@ 的 key" = "Paste %@ key";
+"打开 %@" = "Open %@";
+"这个 key 无效,请检查是否复制完整,或重新创建一个" = "This key doesn't work. Check it was copied in full, or create a new one";
+"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "No key starting with sk- in clipboard. Copy one from %@ first.";
+"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "No key starting with sk- on the clipboard. Copy it from the Ling platform first.";
+"只保存在这台 Mac 上,只发给 %@" = "Stored only on this Mac, sent only to %@";
+"少了:" = "Missing:";
+"(只有 Ling 支持)" = "(Ling only)";
+"自然的同传声音、你自己的声音" = "Natural interpreting voice, your own voice";
"在 Ling 开放平台创建 key" = "Create a key on the Ling platform";
-"注册或登录后点“创建令牌”" = "Sign up or log in, then click “Create Credential”";
+"国内直接注册,不用代理;登录后点“创建令牌”" = "Sign up directly in China without a proxy; click \"Create Token\" after signing in";
"打开 Ling 开放平台" = "Open Ling platform";
"复制 sk- 开头的 key,回来粘贴" = "Copy the key that starts with sk-, then paste it here";
-"粘贴并检查" = "Paste and Check";
-"这个 key 无效,请检查是否复制完整,或重新创建一个" = "This key doesn't work. Check it was copied in full, or create a new one";
-"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "No key starting with sk- on the clipboard. Copy it from the Ling platform first.";
-"只保存在这台 Mac 上,只发给 Ling" = "Stored only on this Mac, sent only to Ling";
"现在可以用了" = "Now available";
"开会时,纪要会跟着字幕一起更新。" = "In meetings, the notes update along with the subtitles.";
-"更准的翻译" = "Sharper translation";
"人名、术语前后一致" = "Names and terms stay consistent";
"自然人声" = "Natural voices";
"同传约 2 秒出声" = "Interpreting speaks in ~2 s";
@@ -476,6 +539,7 @@
"接上 Ling 才有" = "Needs Ling";
"实时纪要和会后总结" = "Live notes and a summary after";
"自然人声,约 2 秒出声" = "Natural voices in about 2 s";
+"粘贴并检查" = "Paste and Check";
"接上后继续" = "Connect to continue";
"好,先这样" = "OK, skip for now";
"先不接" = "Skip";
@@ -575,7 +639,6 @@
"切换显示方式" = "Switch display";
"被其他应用占用了,点右边换一个" = "Taken by another app; click to change";
"实时纪要 → 字幕条 → 不显示" = "Live notes → Subtitle bar → None";
-"共享屏幕时让对方看到" = "Show when sharing screen";
"录屏也一样;关着时只有你看得到纪要窗口" = "Recordings too. When off, only you see the notes window";
"字幕条显示时机" = "Show subtitle bar";
"安静多久后收起" = "Tuck away after quiet for";
@@ -651,7 +714,7 @@
"麦克风峰值 %lld dB" = "Mic peak %lld dB";
"本机转写定稿" = "Final transcript on this Mac";
"没有译文" = "No translation";
-"本机(Ming 未成功)" = "This Mac (Ming failed)";
+"本机(%@ 失败)" = "On-device (%@ failed)";
"本机声音" = "Mac voice";
"只录到静音" = "Only silence recorded";
"录到 %@ 秒声音" = "Recorded %@ s of sound";
@@ -735,8 +798,8 @@
"没能自动更新:%@。已打开下载页" = "Couldn’t update automatically: %@. Opened the download page";
"安装后自动重新打开" = "Reopens after installing";
"更新说明" = "Release Notes";
-"版本 %@" = "Version %@";
"登录时打开" = "Open at Login";
+"版本 %@" = "Version %@";
"首次引导" = "Getting started";
"请在“系统设置 › 通用 › 登录项”中允许" = "Allow it in System Settings › General › Login Items";
"开机后在菜单栏待命,不弹窗口" = "Waits in the menu bar, no windows";
@@ -752,9 +815,6 @@
/* Updater */
"新版本需要 macOS %@ 或更新版本" = "The new version needs macOS %@ or later";
-"在系统设置里打开后,要重新打开知了" = "After turning it on in System Settings, reopen Cicada";
-"重新打开" = "Reopen";
-"请在系统设置里允许“系统音频录制”,再重新打开知了" = "Allow System Audio Recording in System Settings, then reopen Cicada";
"下载的不是预期的版本" = "The download isn’t the expected version";
"下载的文件校验不通过" = "The download didn’t match its checksum";
"请先把应用拖进“应用程序”文件夹" = "Move the app to Applications first";
@@ -784,11 +844,11 @@
"系统麦克风还是 %@" = "System mic is still %@";
"别的软件现在听不到你说话" = "Other apps can't hear you now";
"跟随系统的网页听不到译文" = "Pages on the default mic won't hear the translation";
-"导入文件…" = "Import…";
-"再点收起" = "Click to hide";
-"再点打开" = "Click to show";
"显示方式" = "Display";
"轮换" = "to switch";
+"再点收起" = "Click to hide";
+"再点打开" = "Click to show";
+"导入文件…" = "Import…";
"在会议室里开会?" = "Meeting in the room?";
"电脑里 1 分钟没放出声音" = "Nothing has played on this Mac for a minute";
"改听会议室" = "Listen to the room";
@@ -796,8 +856,8 @@
"后台转写 %@ · %lld%%" = "Transcribing %@ · %lld%%";
"后台转写 %@ · %lld%%,还有 %lld 个" = "Transcribing %@ · %lld%%, %lld more";
"屏幕上不出字幕,文字记录照常保存" = "Nothing on screen; the transcript is still saved";
-"什么时候出现" = "Appears";
"填入 API key 后可生成纪要;文字记录照常保存" = "Add an API key for notes; the transcript is saved either way";
+"什么时候出现" = "Appears";
"译文从扬声器念出来" = "Translations are read out from the speakers";
"系统麦克风换成 %@" = "System mic switches to %@";
"译文送进 %@" = "Translations go into %@";
@@ -867,19 +927,25 @@
"从这里播放" = "Play from here";
"正在整理纪要…" = "Writing notes…";
"纪要会在会议进行中自动生成" = "Notes are written during the meeting";
-"使用 Ling 将文字记录整理为总结、议题、结论和人名,约需半分钟。" = "Ling turns the transcript into a summary, topics, conclusions and names. Takes about half a minute.";
+"用 %@ 整理出总结、议题、结论和人名,约半分钟。" = "Uses %@ to organize summary, topics, conclusions, and names in ~30s.";
"前往 设置 › AI 服务 填入 Ling 的 API key 后即可生成。" = "Add a Ling API key in Settings › AI Service to generate them.";
"正在生成…" = "Generating…";
"生成纪要" = "Generate Notes";
"去填 key" = "Add Key";
+"听着不像 %@" = "Doesn't sound like %@";
+"听着不像 %@ 或 %@" = "Doesn't sound like %@ or %@";
+"听着不像已装的语言" = "Doesn't sound like a language installed here";
"听不出是哪种语言,你来选一下" = "Can't tell which language this is. Pick one:";
"更多…" = "More…";
"正在补装 %@ 语音模型,装好后自动判断语言" = "Adding the %@ speech model; the language is detected once it's in";
+"选了就下载它的语音模型,开头这段也会补上" = "Pick one to download its speech model; the start is filled in too";
+"其实是:" = "It's actually:";
"网络连不上,连上后会自动继续" = "No internet. It carries on once you're back online";
"这台 Mac 的磁盘空间不够了" = "This Mac is low on disk space";
"这台 Mac 上的语音模型已满 5 种" = "This Mac already holds the most speech models it allows (5)";
"先用已装的:" = "Use one already here:";
"打开存储空间" = "Open Storage";
+"打开听写设置" = "Open Dictation Settings";
/* VirtualMic */
"%@要安装虚拟麦克风,让会议里的人听到你的翻译。" = "%@ wants to install a virtual microphone so people in the meeting can hear your translation.";
@@ -890,23 +956,27 @@
"%@要让系统认出虚拟麦克风,声音会断约 1 秒。" = "%@ needs to load the virtual microphone; audio will cut out for about 1 second.";
/* VoicePicker */
-"声音" = "Voice";
"选择对方听到的声音" = "Choose the voice they hear";
"试听" = "Preview";
"系统声音" = "System voice";
"你的音色" = "Your voice";
"填入 Ling key:声音更自然,还能用你自己的声音" = "Add a Ling key for more natural voices, including your own";
+"填好 AI 服务的 key,声音更自然" = "Add an AI Service key for a more natural voice";
"去填写" = "Add key";
"每种语言各记一个声音" = "Each language remembers its voice";
"对方说%@时用" = "Used when they speak %@";
"(当前)" = " (now)";
+"%@ 用不了时,自动换本机声音" = "Falls back to on-device voice if %@ is unavailable";
+"这个服务不出声音,用本机声音" = "This service has no voice; using on-device voice";
"Ling 不可用时自动换成本机声音" = "Falls back to the Mac's voice when Ling is unavailable";
"填入 Ling key 后可用 Ming 声音和你自己的声音" = "With a Ling key you can use Ming voices and your own voice";
"慢约 1 秒" = "~1 s slower";
"最快" = "Fastest";
+"去换成 Ling" = "Switch to Ling";
+"我自己的声音" = "My own voice";
+"只有 Ling 能用你自己的声音" = "Only Ling supports your own voice";
"用我自己的声音" = "Use my own voice";
"录制" = "Record";
-"我自己的声音" = "My own voice";
"录 15 秒原声,对方听到你的音色,晚约 3 秒" = "Record 15 s so they hear your own voice, about 3 s later";
"已录 %lld 秒 · %@" = "Recorded %lld s · %@";
"重录" = "Re-record";
@@ -930,10 +1000,8 @@
"用这个声音" = "Use This Voice";
/* Voices */
-"女" = "Female";
"美式" = "American";
"自然对话" = "Conversational";
-"男" = "Male";
"英式" = "British";
"稳重" = "Steady";
"平稳" = "Even";
@@ -952,9 +1020,3 @@
"无法打开麦克风:%@" = "Can't open the microphone: %@";
"录音太短了,请至少朗读 %lld 秒" = "Too short; read for at least %lld seconds";
"没听清录音内容,请换个安静的地方再录一次" = "Couldn't make out the recording; try again somewhere quiet";
-"听着不像 %@" = "Doesn't sound like %@";
-"听着不像 %@ 或 %@" = "Doesn't sound like %@ or %@";
-"听着不像已装的语言" = "Doesn't sound like a language installed here";
-"选了就下载它的语音模型,开头这段也会补上" = "Pick one to download its speech model; the start is filled in too";
-"其实是:" = "It's actually:";
-"打开听写设置" = "Open Dictation Settings";
diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings
index c82c0b5..1a431b9 100644
--- a/Resources/ja.lproj/Localizable.strings
+++ b/Resources/ja.lproj/Localizable.strings
@@ -1,40 +1,85 @@
+/* AIProviders */
+"更准" = "より正確";
+"更快、更省" = "高速・低コスト";
+"女" = "女性";
+"男" = "男性";
+"和 Ling 同款" = "Ling と同じ";
+"中文好" = "中国語に強い";
+"效果和价格最均衡" = "品質と価格のバランスが最良";
+"更省" = "低コスト";
+"够用、更省" = "実用十分・低コスト";
+"自定义服务" = "カスタムサービス";
+
/* AISettings */
-"用在哪里" = "使いどころ";
-"一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。" = "1時間の会議で約¥0.15〜1(現在は優待価格)。送信されるのはテキストだけです(自分の声を使う場合はその録音も)。音声認識はこのMac内で行われます。";
+"其他(兼容 OpenAI)" = "その他(OpenAI 互換)";
+"现在能用的" = "現在使える機能";
+"用 %@" = "%@ を使用";
"实时纪要" = "ライブ議事メモ";
-"用 Ling" = "Ling を使う";
"需要 key" = "キーが必要";
"会中每 45 秒更新" = "会議中は45秒ごとに更新";
"填好 key 后可用" = "キーを設定すると使えます";
"翻译" = "翻訳";
-"整句用 Ling;不行时换 Google、本机" = "文単位で Ling。使えない場合は Google、オンデバイスに切り替え";
-"整句用 Ling;不行时换 Google" = "文単位で Ling。使えない場合は Google に切り替え";
+"整句用它;不行时换 Google、本机" = "文単位で使用(不可時は Google、オンデバイスに切替)";
+"整句用它;不行时换 Google" = "文単位で使用(不可時は Google に切替)";
"没有 key 时照常可用" = "キーがなくても使えます";
-"语音识别" = "音声認識";
+"同传声音" = "同時通訳の声";
"本机" = "オンデバイス";
+"你自己的声音" = "自分の声";
+"录一段,让对方听到你的音色" = "少し録音して、相手にあなたの声を届けます";
+"只有 Ling" = "Ling のみ";
+"换用 Ling 才有" = "Ling に切り替えると使えます";
+"语音识别" = "音声認識";
"更快,不花钱" = "高速で無料";
-"同声传译的声音" = "同時通訳の音声";
-"Ming 的声音或你自己的声音" = "Ming の音声、またはあなた自身の声";
-"没有 key 时用本机声音" = "キーがない場合は Mac の音声を使用";
-"去选声音" = "音声を選ぶ";
+"自己选模型" = "モデルを自分で選ぶ";
"模型" = "モデル";
"3.1 更准;3.0 更快、更省" = "3.1 は高精度、3.0 は高速で低コスト";
-"在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。" = "Ling のプラットフォームで「トークンを作成」をクリックし、sk- で始まる文字列をコピーします。";
-"打开 Ling 开放平台 ↗" = "Ling プラットフォームを開く ↗";
+"文字模型" = "テキストモデル";
+"纪要和整句翻译" = "議事メモと文単位の翻訳";
+"声音模型" = "音声モデル";
+"同传念给对方" = "同時通訳の読み上げ";
+"一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。" = "1時間の会議で約¥0.15〜1(現在は優待価格)。送信されるのはテキストだけです(自分の声を使う場合はその録音も)。音声認識はこのMac内で行われます。";
+"按所选模型计费。发出去的只有文字,语音识别留在本机。" = "選択したモデルに応じて課金されます。送信されるのはテキストのみで、音声認識はオンデバイスで行われます。";
+"在 %@ 创建 key,复制后粘贴到这里。" = "%@ でキーを作成し、コピーしてここに貼り付けてください。";
+"打开 %@ ↗" = "%@ を開く ↗";
+"还没填好" = "未入力の項目があります";
"还没填 API key" = "API key が未設定";
"正在检查…" = "確認中…";
"已连接" = "接続済み";
"这个 key 用不了" = "このキーは使えません";
"暂时连不上" = "現在接続できません";
"%@ · 响应约 %@ 秒" = "%1$@ · 応答 約%2$@秒";
-"Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个" = "Ling がこのトークンは無効だと通知しました。全体をコピーできているか確認するか、新しく作成してください";
+"%@ 提示 key 无效,请检查是否复制完整,或重新创建一个" = "%@ からキーが無効と返されました。すべてコピーされているか確認するか、新しく作成してください";
"不填 key 时,字幕和翻译仍可正常使用" = "キーがなくても、字幕と翻訳は通常どおり使えます";
"更换" = "変更";
"重试" = "再試行";
"保存并检查" = "保存して確認";
"取消" = "キャンセル";
-"只存在这台 Mac 上(只有你的账户能读),只发给 Ling(ant-ling.com)" = "このMacにのみ保存され、Ling(ant-ling.com)にのみ送信されます";
+"本机服务可不填" = "ローカルサービスでは省略可";
"移除" = "削除";
+"只存在这台 Mac 上(只有你的账户能读),只发给 %@" = "この Mac にのみ保存され(あなたのアカウントのみ読み取り可)、%@ にのみ送信されます";
+"只存在这台 Mac 上(只有你的账户能读),只发给 %@(%@)" = "この Mac にのみ保存され(あなたのアカウントのみ読み取り可)、%@(%@)にのみ送信されます";
+"地址需用 https,仅 localhost 可用 http。" = "URL には https が必要です(localhost のみ http 可)。";
+"地址" = "URL";
+"例如 qwen3:14b" = "例: qwen3:14b";
+"你填的地址" = "入力した URL";
+"Ming 的声音" = "Ming の声";
+"没有 key 时用本机声音" = "キーがない場合は Mac の音声を使用";
+"没填声音模型,用本机声音" = "音声モデル未入力のため、オンデバイス音声を使用";
+"%@ 暂不能出声音,用本机声音" = "%@ は音声非対応のため、オンデバイス音声を使用";
+"声音(可选)" = "音声(任意)";
+"需支持 /audio/speech;不填则用本机声音。" = "/audio/speech の対応が必要です。未入力の場合はオンデバイス音声を使います。";
+"例如 kokoro" = "例: kokoro";
+"声音" = "声";
+"例如 af_heart" = "例: af_heart";
+"跟上面一样" = "上と同じ";
+"(推荐)" = "(推奨)";
+"模型名" = "モデル名";
+"好" = "OK";
+"推荐" = "推奨";
+"全部 %lld 个" = "すべて(%lld 件)";
+"填其他模型名…" = "他のモデル名を入力…";
+"其他" = "その他";
+"选一个" = "選択してください";
/* AboutPanel */
"把 Mac 正在播放的声音变成实时双语字幕和会议纪要" = "Mac で再生中の音声を、リアルタイムの対訳字幕と議事録に";
@@ -228,7 +273,11 @@
"会议原文" = "会議の原文";
/* Ling */
-"连不上 Ling,检查网络或代理" = "Ling に接続できません。ネットワークまたはプロキシを確認してください";
+"这个服务" = "このサービス";
+"找不到模型,或地址不对(HTTP %lld)" = "モデルが見つからないか、URL が間違っています(HTTP %lld)";
+"%@ 拒绝了请求(HTTP %lld),请检查模型名" = "%@ がリクエストを拒否しました(HTTP %lld)。モデル名を確認してください";
+"连不上 %@,请检查网络或代理" = "%@ に接続できません。ネットワークまたはプロキシを確認してください";
+"这个服务不支持 JSON(HTTP %lld),纪要用不了" = "このサービスは JSON 非対応(HTTP %lld)のため、議事メモは使えません";
/* ListenEngine */
"%@(识别中…)→ %@" = "%1$@(検出中…)→ %2$@";
@@ -236,6 +285,7 @@
"等你允许使用麦克风" = "マイクの許可を待っています";
"正在听" = "聞き取り中";
"此 Mac 不支持本机语音识别" = "このMacはオンデバイス音声認識に対応していません";
+"请在系统设置里允许“系统音频录制”,再重新打开知了" = "システム設定で「システムオーディオ録音」を許可して、Cicada を開き直してください";
"无法读取系统音频,请在系统设置里允许“系统音频录制”" = "システム音声を読み取れません。システム設定で「システム音声の録音」を許可してください";
"没能下载 %@ 语音模型" = "%@ の音声モデルをダウンロードできませんでした";
"已暂停" = "一時停止中";
@@ -333,12 +383,13 @@
"%lld 分钟前更新" = "%lld分前に更新";
"这场会议的语言" = "この会議の言語";
"整理中" = "整理中";
+"共享屏幕时让对方看到" = "画面共有で相手にも見せる";
"对方可见" = "相手に表示中";
"仅自己可见" = "自分だけ";
-"对方可见 · 点击关闭" = "相手に表示中 · クリックでオフ";
-"仅自己可见 · 点击共享" = "自分だけ · クリックで共有";
"文字记录 · %lld" = "文字起こし · %lld";
"文字记录" = "文字起こし";
+"对方可见 · 点击关闭" = "相手に表示中 · クリックでオフ";
+"仅自己可见 · 点击共享" = "自分だけ · クリックで共有";
"在文字记录中搜索 ⌘F" = "文字起こしを検索 ⌘F";
"无结果" = "結果なし";
"上一个" = "前へ";
@@ -365,8 +416,8 @@
"开始新会议" = "新しい会議を開始";
"更换 key" = "キーを変更";
"生成纪要需要 API key" = "議事メモの作成には API key が必要です";
-"文字记录仍在正常保存。填入 Ling 的 key 后,会从头开始整理整场会议的内容。" = "文字起こしは引き続き保存されています。Ling のキーを入力すると、会議全体の議事メモを最初から作成します。";
-"获取 Ling key ↗" = "Ling のキーを取得 ↗";
+"文字记录仍在保存。填好 %@ 的 key 后,会从头整理出整场纪要。" = "文字起こしは保存されています。%@ のキーを入力すると、最初から議事メモをまとめます。";
+"获取 %@ key ↗" = "%@ のキーを取得 ↗";
"保存并开始" = "保存して開始";
"没有进行中的会议" = "進行中の会議はありません";
"这场会议还没有纪要" = "この会議にはまだ議事メモがありません";
@@ -408,11 +459,13 @@
"字幕和纪要都从这里来。去系统设置打开,回来会自动识别。" = "字幕も議事メモもここから。システム設定でオンにすると、戻ったときに自動で認識します。";
"声音只在本机识别" = "音声はこのMac内でのみ認識されます";
"听电脑里的声音" = "Mac の音声を聞く";
+"在系统设置里打开后,要重新打开知了" = "システム設定でオンにしたら、Cicada を開き直してください";
"只听声音,不录屏幕画面" = "音だけ。画面は録画しません";
"识别语音" = "音声を認識";
"打开“听写”,允许“语音识别”" = "「音声入力」をオンにして「音声認識」を許可";
"已打开" = "オン";
"去开启" = "オンにする";
+"重新打开" = "開き直す";
"放一段会议试试" = "会議を流してみる";
"一段 9 秒的英文会议,字幕会跟着声音实时出来。" = "9 秒の英語の会議です。話すそばから字幕が出ます。";
"听到" = "検出";
@@ -449,21 +502,31 @@
"下一步接上 Ling 就有" = "次のステップで Ling をつなぐと使えます";
/* OnboardingKey */
-"接上 Ling,用上完整的知了" = "Ling をつないで、Cicada をフルに使う";
-"纪要、更准的翻译和自然的同传语音都靠它,约 1 分钟。" = "議事メモ、より正確な翻訳、自然な通訳音声はすべて Ling で動きます。約 1 分です。";
+"用其他服务" = "他のサービスを使う";
+"纪要和翻译都能用,模型已经选好。" = "議事メモも翻訳も使えます。モデルは選択済みです。";
+"接上 Ling,一个 key 用上全部功能" = "Ling に接続して、1つのキーですべての機能を";
+"更准的翻译" = "より正確な翻訳";
+"自然的同传声音" = "自然な同時通訳の声";
+"用你自己的声音" = "自分の声を使う";
"Ling 每月赠送 ¥10 额度" = "Ling から毎月 ¥10 分の無料枠";
"约够 10–50 小时会议" = "会議約 10〜50 時間分";
+"‹ 还是用 Ling" = "‹ やはり Ling を使う";
+"用不了 Ling?" = "Ling が使えませんか?";
+"粘贴 %@ 的 key" = "%@ のキーを貼り付け";
+"打开 %@" = "%@ を開く";
+"这个 key 无效,请检查是否复制完整,或重新创建一个" = "この key は無効です。最後までコピーできているか確認するか、作り直してください";
+"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "クリップボードに sk- で始まるキーがありません。先に %@ でコピーしてください。";
+"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "クリップボードに sk- で始まるキーがありません。先に Ling プラットフォームでコピーしてください。";
+"只保存在这台 Mac 上,只发给 %@" = "この Mac にのみ保存され、%@ にのみ送信されます";
+"少了:" = "使えない機能:";
+"(只有 Ling 支持)" = "(Ling のみ対応)";
+"自然的同传声音、你自己的声音" = "自然な同時通訳の声、自分の声";
"在 Ling 开放平台创建 key" = "Ling プラットフォームで key を作成";
-"注册或登录后点“创建令牌”" = "登録またはログインして「Create Credential」をクリック";
+"国内直接注册,不用代理;登录后点“创建令牌”" = "中国国内からプロキシなしで登録可能。ログイン後に「トークンを作成」をクリック";
"打开 Ling 开放平台" = "Ling プラットフォームを開く";
"复制 sk- 开头的 key,回来粘贴" = "sk- で始まるキーをコピーして、ここに貼り付け";
-"粘贴并检查" = "貼り付けて確認";
-"这个 key 无效,请检查是否复制完整,或重新创建一个" = "この key は無効です。最後までコピーできているか確認するか、作り直してください";
-"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "クリップボードに sk- で始まるキーがありません。先に Ling プラットフォームでコピーしてください。";
-"只保存在这台 Mac 上,只发给 Ling" = "この Mac にのみ保存され、Ling にのみ送信されます";
"现在可以用了" = "使えるようになったもの";
"开会时,纪要会跟着字幕一起更新。" = "会議中は、議事メモが字幕と一緒に更新されます。";
-"更准的翻译" = "より正確な翻訳";
"人名、术语前后一致" = "人名や用語が一貫";
"自然人声" = "自然な音声";
"同传约 2 秒出声" = "通訳は約 2 秒で発話";
@@ -476,6 +539,7 @@
"接上 Ling 才有" = "Ling が必要";
"实时纪要和会后总结" = "ライブ議事メモと会議後のまとめ";
"自然人声,约 2 秒出声" = "自然な音声、約 2 秒で発話";
+"粘贴并检查" = "貼り付けて確認";
"接上后继续" = "つないでから次へ";
"好,先这样" = "OK、今はこれで";
"先不接" = "スキップ";
@@ -575,7 +639,6 @@
"切换显示方式" = "表示方法を切り替え";
"被其他应用占用了,点右边换一个" = "他のアプリで使用中です。右をクリックして変更してください";
"实时纪要 → 字幕条 → 不显示" = "ライブ議事メモ → 字幕バー → 表示しない";
-"共享屏幕时让对方看到" = "画面共有で相手にも見せる";
"录屏也一样;关着时只有你看得到纪要窗口" = "録画も同じ。オフなら議事メモのウィンドウは自分にしか見えません";
"字幕条显示时机" = "字幕バーの表示タイミング";
"安静多久后收起" = "無音からたたむまでの時間";
@@ -651,7 +714,7 @@
"麦克风峰值 %lld dB" = "マイクのピーク %lld dB";
"本机转写定稿" = "この Mac で書き起こし確定";
"没有译文" = "訳なし";
-"本机(Ming 未成功)" = "この Mac(Ming 失敗)";
+"本机(%@ 失败)" = "オンデバイス(%@ 失敗)";
"本机声音" = "Mac の声";
"只录到静音" = "無音のみ録音";
"录到 %@ 秒声音" = "%@ 秒の音を録音";
@@ -735,8 +798,8 @@
"没能自动更新:%@。已打开下载页" = "自動アップデートできませんでした:%@。ダウンロードページを開きました";
"安装后自动重新打开" = "インストール後に自動で再起動";
"更新说明" = "リリースノート";
-"版本 %@" = "バージョン %@";
"登录时打开" = "ログイン時に開く";
+"版本 %@" = "バージョン %@";
"首次引导" = "はじめに";
"请在“系统设置 › 通用 › 登录项”中允许" = "「システム設定 › 一般 › ログイン項目」で許可してください";
"开机后在菜单栏待命,不弹窗口" = "メニューバーで待機し、ウインドウは開きません";
@@ -752,9 +815,6 @@
/* Updater */
"新版本需要 macOS %@ 或更新版本" = "新しいバージョンには macOS %@ 以降が必要です";
-"在系统设置里打开后,要重新打开知了" = "システム設定でオンにしたら、Cicada を開き直してください";
-"重新打开" = "開き直す";
-"请在系统设置里允许“系统音频录制”,再重新打开知了" = "システム設定で「システムオーディオ録音」を許可して、Cicada を開き直してください";
"下载的不是预期的版本" = "ダウンロードしたものが想定のバージョンではありません";
"下载的文件校验不通过" = "ダウンロードしたファイルのチェックサムが一致しません";
"请先把应用拖进“应用程序”文件夹" = "先にアプリを「アプリケーション」フォルダに移動してください";
@@ -784,11 +844,11 @@
"系统麦克风还是 %@" = "システムのマイクがまだ %@ です";
"别的软件现在听不到你说话" = "ほかのアプリにあなたの声が届きません";
"跟随系统的网页听不到译文" = "システムに合わせるページに訳が届きません";
-"导入文件…" = "読み込む…";
-"再点收起" = "もう一度で閉じる";
-"再点打开" = "もう一度で開く";
"显示方式" = "表示方法";
"轮换" = "で切り替え";
+"再点收起" = "もう一度で閉じる";
+"再点打开" = "もう一度で開く";
+"导入文件…" = "読み込む…";
"在会议室里开会?" = "会議室で会議中?";
"电脑里 1 分钟没放出声音" = "1 分間 Mac から音が出ていません";
"改听会议室" = "会議室を聞く";
@@ -796,8 +856,8 @@
"后台转写 %@ · %lld%%" = "%@ を文字起こし中 · %lld%%";
"后台转写 %@ · %lld%%,还有 %lld 个" = "%@ を文字起こし中 · %lld%%、残り %lld 件";
"屏幕上不出字幕,文字记录照常保存" = "画面には何も出しません。文字起こしは保存されます";
-"什么时候出现" = "表示するタイミング";
"填入 API key 后可生成纪要;文字记录照常保存" = "API key を入力すると議事メモを作成できます。文字起こしは常に保存されます";
+"什么时候出现" = "表示するタイミング";
"译文从扬声器念出来" = "訳文はスピーカーから読み上げます";
"系统麦克风换成 %@" = "システムのマイクを %@ に切り替え";
"译文送进 %@" = "訳文を %@ に送ります";
@@ -867,19 +927,25 @@
"从这里播放" = "ここから再生";
"正在整理纪要…" = "議事メモを作成中…";
"纪要会在会议进行中自动生成" = "議事メモは会議中に自動で作成されます";
-"使用 Ling 将文字记录整理为总结、议题、结论和人名,约需半分钟。" = "Ling が文字起こしを、まとめ・議題・結論・人名に整理します。約30秒かかります。";
+"用 %@ 整理出总结、议题、结论和人名,约半分钟。" = "%@ で要約・議題・結論・人名を30秒ほどで整理します。";
"前往 设置 › AI 服务 填入 Ling 的 API key 后即可生成。" = "設定 › AI サービス で Ling の API key を入力すると作成できます。";
"正在生成…" = "作成中…";
"生成纪要" = "議事メモを作成";
"去填 key" = "キーを入力";
+"听着不像 %@" = "%@ではなさそうです";
+"听着不像 %@ 或 %@" = "%@でも%@でもなさそうです";
+"听着不像已装的语言" = "入っている言語ではなさそうです";
"听不出是哪种语言,你来选一下" = "言語を判別できません。選んでください";
"更多…" = "その他…";
"正在补装 %@ 语音模型,装好后自动判断语言" = "%@ の音声モデルを追加中。追加後に言語を自動判別します";
+"选了就下载它的语音模型,开头这段也会补上" = "選ぶと音声モデルをダウンロードし、最初の部分も書き起こします";
+"其实是:" = "実は:";
"网络连不上,连上后会自动继续" = "ネットワークに接続できません。つながると自動で続けます";
"这台 Mac 的磁盘空间不够了" = "この Mac のディスク容量が足りません";
"这台 Mac 上的语音模型已满 5 种" = "この Mac の音声モデルが上限の 5 つに達しています";
"先用已装的:" = "入っている言語で続ける:";
"打开存储空间" = "ストレージを開く";
+"打开听写设置" = "音声入力の設定を開く";
/* VirtualMic */
"%@要安装虚拟麦克风,让会议里的人听到你的翻译。" = "%@は仮想マイクをインストールし、会議の参加者にあなたの翻訳を聞こえるようにします。";
@@ -890,23 +956,27 @@
"%@要让系统认出虚拟麦克风,声音会断约 1 秒。" = "%@が仮想マイクをシステムに認識させるため、音声が約1秒途切れます。";
/* VoicePicker */
-"声音" = "声";
"选择对方听到的声音" = "相手に聞こえる声を選ぶ";
"试听" = "試聴";
"系统声音" = "システムの声";
"你的音色" = "あなたの声色";
"填入 Ling key:声音更自然,还能用你自己的声音" = "Ling key を入れると、より自然な声や自分の声が使えます";
+"填好 AI 服务的 key,声音更自然" = "AI サービスのキーを設定すると、声がより自然になります";
"去填写" = "入力する";
"每种语言各记一个声音" = "言語ごとに声を記憶します";
"对方说%@时用" = "相手が%@のときに使用";
"(当前)" = "(現在)";
+"%@ 用不了时,自动换本机声音" = "%@ が使えない時は、自動でオンデバイス音声に切替";
+"这个服务不出声音,用本机声音" = "このサービスは音声非対応のため、オンデバイス音声を使用";
"Ling 不可用时自动换成本机声音" = "Ling が使えないときは Mac の声に切り替わります";
"填入 Ling key 后可用 Ming 声音和你自己的声音" = "Ling key を入れると Ming の声と自分の声が使えます";
"慢约 1 秒" = "約 1 秒遅い";
"最快" = "最速";
+"去换成 Ling" = "Ling に切り替える";
+"我自己的声音" = "自分の声";
+"只有 Ling 能用你自己的声音" = "自分の声を使えるのは Ling だけです";
"用我自己的声音" = "自分の声を使う";
"录制" = "録音";
-"我自己的声音" = "自分の声";
"录 15 秒原声,对方听到你的音色,晚约 3 秒" = "15 秒録音すると相手にあなたの声で届きます(約 3 秒遅れ)";
"已录 %lld 秒 · %@" = "%lld 秒録音済み · %@";
"重录" = "録り直す";
@@ -930,10 +1000,8 @@
"用这个声音" = "この声を使う";
/* Voices */
-"女" = "女性";
"美式" = "アメリカ英語";
"自然对话" = "会話調";
-"男" = "男性";
"英式" = "イギリス英語";
"稳重" = "落ち着き";
"平稳" = "安定";
@@ -952,9 +1020,3 @@
"无法打开麦克风:%@" = "マイクを開けません: %@";
"录音太短了,请至少朗读 %lld 秒" = "録音が短すぎます。%lld秒以上読み上げてください";
"没听清录音内容,请换个安静的地方再录一次" = "録音を聞き取れませんでした。静かな場所でもう一度録音してください";
-"听着不像 %@" = "%@ではなさそうです";
-"听着不像 %@ 或 %@" = "%@でも%@でもなさそうです";
-"听着不像已装的语言" = "入っている言語ではなさそうです";
-"选了就下载它的语音模型,开头这段也会补上" = "選ぶと音声モデルをダウンロードし、最初の部分も書き起こします";
-"其实是:" = "実は:";
-"打开听写设置" = "音声入力の設定を開く";
diff --git a/Resources/ko.lproj/Localizable.strings b/Resources/ko.lproj/Localizable.strings
index 5c3b7b4..081457d 100644
--- a/Resources/ko.lproj/Localizable.strings
+++ b/Resources/ko.lproj/Localizable.strings
@@ -1,40 +1,85 @@
+/* AIProviders */
+"更准" = "더 정확함";
+"更快、更省" = "더 빠르고 저렴함";
+"女" = "여성";
+"男" = "남성";
+"和 Ling 同款" = "Ling과 동일";
+"中文好" = "중국어에 강함";
+"效果和价格最均衡" = "품질과 가격의 최적 균형";
+"更省" = "더 저렴함";
+"够用、更省" = "충분한 성능, 더 저렴함";
+"自定义服务" = "사용자 지정 서비스";
+
/* AISettings */
-"用在哪里" = "사용처";
-"一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。" = "시간당 회의 비용은 약 ¥0.15–1입니다(현재 할인가). 전송되는 것은 텍스트뿐이며(내 목소리를 쓸 때는 그 녹음도 포함), 음성 인식은 이 Mac에서 처리됩니다.";
+"其他(兼容 OpenAI)" = "기타 (OpenAI 호환)";
+"现在能用的" = "지금 사용 가능";
+"用 %@" = "%@ 사용";
"实时纪要" = "실시간 회의록";
-"用 Ling" = "Ling 사용";
"需要 key" = "key 필요";
"会中每 45 秒更新" = "회의 중 45초마다 업데이트";
"填好 key 后可用" = "key를 입력하면 사용할 수 있습니다";
"翻译" = "번역";
-"整句用 Ling;不行时换 Google、本机" = "문장 단위는 Ling, 실패하면 Google, 온디바이스 순";
-"整句用 Ling;不行时换 Google" = "문장 단위는 Ling, 실패하면 Google";
+"整句用它;不行时换 Google、本机" = "전체 문장에 사용, 실패 시 Google 및 온디바이스로 전환";
+"整句用它;不行时换 Google" = "전체 문장에 사용, 실패 시 Google로 전환";
"没有 key 时照常可用" = "key 없이도 사용 가능";
-"语音识别" = "음성 인식";
+"同传声音" = "동시통역 음성";
"本机" = "온디바이스";
+"你自己的声音" = "내 목소리";
+"录一段,让对方听到你的音色" = "짧게 녹음하여 상대방에게 내 목소리로 전달";
+"只有 Ling" = "Ling 전용";
+"换用 Ling 才有" = "Ling으로 전환해야 사용 가능";
+"语音识别" = "음성 인식";
"更快,不花钱" = "더 빠르고 무료";
-"同声传译的声音" = "동시통역 음성";
-"Ming 的声音或你自己的声音" = "Ming 음성 또는 내 목소리";
-"没有 key 时用本机声音" = "key가 없으면 이 Mac의 음성 사용";
-"去选声音" = "음성 선택";
+"自己选模型" = "직접 모델 선택";
"模型" = "모델";
"3.1 更准;3.0 更快、更省" = "3.1은 더 정확, 3.0은 더 빠르고 저렴";
-"在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。" = "Ling 개발자 플랫폼에서 “토큰 만들기”를 클릭하고 sk-로 시작하는 문자열을 복사하세요.";
-"打开 Ling 开放平台 ↗" = "Ling 개발자 플랫폼 열기 ↗";
+"文字模型" = "텍스트 모델";
+"纪要和整句翻译" = "회의록 및 전체 문장 번역";
+"声音模型" = "음성 모델";
+"同传念给对方" = "동시통역 시 상대방에게 들려줄 음성";
+"一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。" = "시간당 회의 비용은 약 ¥0.15–1입니다(현재 할인가). 전송되는 것은 텍스트뿐이며(내 목소리를 쓸 때는 그 녹음도 포함), 음성 인식은 이 Mac에서 처리됩니다.";
+"按所选模型计费。发出去的只有文字,语音识别留在本机。" = "선택한 모델 기준으로 과금됩니다. 텍스트만 전송되며 음성 인식은 온디바이스에서 처리됩니다.";
+"在 %@ 创建 key,复制后粘贴到这里。" = "%@에서 key를 생성한 후 복사하여 여기에 붙여넣으세요.";
+"打开 %@ ↗" = "%@ 열기 ↗";
+"还没填好" = "아직 입력되지 않음";
"还没填 API key" = "API key 없음";
"正在检查…" = "확인 중…";
"已连接" = "연결됨";
"这个 key 用不了" = "이 key는 사용할 수 없음";
"暂时连不上" = "지금은 연결할 수 없음";
"%@ · 响应约 %@ 秒" = "%1$@ · 응답 약 %2$@초";
-"Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个" = "Ling에서 이 토큰이 유효하지 않다고 합니다. 전체를 복사했는지 확인하거나 새로 만드세요";
+"%@ 提示 key 无效,请检查是否复制完整,或重新创建一个" = "%@에서 유효하지 않은 key라고 합니다. 전체가 복사되었는지 확인하거나 새로 생성하세요";
"不填 key 时,字幕和翻译仍可正常使用" = "key 없이도 자막과 번역은 사용할 수 있습니다";
"更换" = "변경";
"重试" = "다시 시도";
"保存并检查" = "저장 및 확인";
"取消" = "취소";
-"只存在这台 Mac 上(只有你的账户能读),只发给 Ling(ant-ling.com)" = "이 Mac에만 저장되며(내 계정만 읽을 수 있음) Ling(ant-ling.com)으로만 전송됩니다";
+"本机服务可不填" = "로컬 서비스는 비워둘 수 있음";
"移除" = "제거";
+"只存在这台 Mac 上(只有你的账户能读),只发给 %@" = "이 Mac에만 저장되며(내 계정만 읽기 가능) %@에만 전송됩니다";
+"只存在这台 Mac 上(只有你的账户能读),只发给 %@(%@)" = "이 Mac에만 저장되며(내 계정만 읽기 가능) %@(%@)에만 전송됩니다";
+"地址需用 https,仅 localhost 可用 http。" = "주소는 https를 사용해야 하며, localhost만 http를 사용할 수 있습니다.";
+"地址" = "주소";
+"例如 qwen3:14b" = "예: qwen3:14b";
+"你填的地址" = "입력한 주소";
+"Ming 的声音" = "Ming의 음성";
+"没有 key 时用本机声音" = "key가 없으면 이 Mac의 음성 사용";
+"没填声音模型,用本机声音" = "음성 모델 미입력, 온디바이스 음성 사용";
+"%@ 暂不能出声音,用本机声音" = "%@에서 아직 음성을 지원하지 않아 온디바이스 음성 사용";
+"声音(可选)" = "음성 (선택 사항)";
+"需支持 /audio/speech;不填则用本机声音。" = "/audio/speech 지원 필요. 비워두면 온디바이스 음성을 사용합니다.";
+"例如 kokoro" = "예: kokoro";
+"声音" = "목소리";
+"例如 af_heart" = "예: af_heart";
+"跟上面一样" = "위와 동일";
+"(推荐)" = "(추천)";
+"模型名" = "모델 이름";
+"好" = "확인";
+"推荐" = "추천";
+"全部 %lld 个" = "전체 %lld개";
+"填其他模型名…" = "다른 모델 이름 입력…";
+"其他" = "기타";
+"选一个" = "선택";
/* AboutPanel */
"把 Mac 正在播放的声音变成实时双语字幕和会议纪要" = "Mac에서 재생 중인 소리를 실시간 이중 언어 자막과 회의록으로";
@@ -228,7 +273,11 @@
"会议原文" = "회의 원어";
/* Ling */
-"连不上 Ling,检查网络或代理" = "Ling에 연결할 수 없습니다. 네트워크나 프록시를 확인하세요";
+"这个服务" = "이 서비스";
+"找不到模型,或地址不对(HTTP %lld)" = "모델을 찾을 수 없거나 주소가 잘못됨 (HTTP %lld)";
+"%@ 拒绝了请求(HTTP %lld),请检查模型名" = "%@에서 요청을 거부함(HTTP %lld). 모델 이름을 확인하세요";
+"连不上 %@,请检查网络或代理" = "%@에 연결할 수 없음. 네트워크 또는 프록시를 확인하세요";
+"这个服务不支持 JSON(HTTP %lld),纪要用不了" = "이 서비스는 JSON을 지원하지 않아(HTTP %lld) 회의록을 사용할 수 없음";
/* ListenEngine */
"%@(识别中…)→ %@" = "%1$@(감지 중…) → %2$@";
@@ -236,6 +285,7 @@
"等你允许使用麦克风" = "마이크 허용을 기다리는 중";
"正在听" = "듣는 중";
"此 Mac 不支持本机语音识别" = "이 Mac은 온디바이스 음성 인식을 지원하지 않습니다";
+"请在系统设置里允许“系统音频录制”,再重新打开知了" = "시스템 설정에서 ‘시스템 오디오 녹음’을 허용한 뒤 Cicada를 다시 열어 주세요";
"无法读取系统音频,请在系统设置里允许“系统音频录制”" = "시스템 오디오를 읽을 수 없습니다. 시스템 설정에서 “시스템 오디오 녹음”을 허용하세요";
"没能下载 %@ 语音模型" = "%@ 음성 모델을 내려받지 못했어요";
"已暂停" = "일시정지됨";
@@ -333,12 +383,13 @@
"%lld 分钟前更新" = "%lld분 전 업데이트됨";
"这场会议的语言" = "이 회의의 언어";
"整理中" = "정리 중";
+"共享屏幕时让对方看到" = "화면 공유 시 상대에게 보이기";
"对方可见" = "상대에게 보임";
"仅自己可见" = "나만 보기";
-"对方可见 · 点击关闭" = "상대에게 보임 · 클릭해 끄기";
-"仅自己可见 · 点击共享" = "나만 보기 · 클릭해 공유";
"文字记录 · %lld" = "대화 기록 · %lld";
"文字记录" = "대화 기록";
+"对方可见 · 点击关闭" = "상대에게 보임 · 클릭해 끄기";
+"仅自己可见 · 点击共享" = "나만 보기 · 클릭해 공유";
"在文字记录中搜索 ⌘F" = "대화 기록에서 검색 ⌘F";
"无结果" = "결과 없음";
"上一个" = "이전";
@@ -365,8 +416,8 @@
"开始新会议" = "새 회의 시작";
"更换 key" = "key 변경";
"生成纪要需要 API key" = "회의록 작성에는 API key가 필요합니다";
-"文字记录仍在正常保存。填入 Ling 的 key 后,会从头开始整理整场会议的内容。" = "대화 기록은 계속 저장되고 있습니다. Ling key를 입력하면 회의 처음부터 전체 내용을 정리합니다.";
-"获取 Ling key ↗" = "Ling key 받기 ↗";
+"文字记录仍在保存。填好 %@ 的 key 后,会从头整理出整场纪要。" = "텍스트 기록은 계속 저장 중입니다. %@의 key를 입력하면 처음부터 전체 회의록을 정리합니다.";
+"获取 %@ key ↗" = "%@ key 받기 ↗";
"保存并开始" = "저장 및 시작";
"没有进行中的会议" = "진행 중인 회의 없음";
"这场会议还没有纪要" = "이 회의에는 아직 회의록이 없습니다";
@@ -408,11 +459,13 @@
"字幕和纪要都从这里来。去系统设置打开,回来会自动识别。" = "자막과 회의록이 모두 여기서 나옵니다. 시스템 설정에서 켜면 돌아왔을 때 자동으로 인식합니다.";
"声音只在本机识别" = "소리는 이 Mac에서만 인식됩니다";
"听电脑里的声音" = "컴퓨터 소리 듣기";
+"在系统设置里打开后,要重新打开知了" = "시스템 설정에서 켠 뒤 Cicada를 다시 열어 주세요";
"只听声音,不录屏幕画面" = "소리만 듣고 화면은 녹화하지 않습니다";
"识别语音" = "음성 인식";
"打开“听写”,允许“语音识别”" = "‘받아쓰기’를 켜고 ‘음성 인식’을 허용";
"已打开" = "켜짐";
"去开启" = "켜기";
+"重新打开" = "다시 열기";
"放一段会议试试" = "회의를 틀어 보세요";
"一段 9 秒的英文会议,字幕会跟着声音实时出来。" = "9초짜리 영어 회의예요. 말하는 대로 자막이 나와요.";
"听到" = "들린 내용";
@@ -449,21 +502,31 @@
"下一步接上 Ling 就有" = "다음 단계에서 Ling을 연결하면 됩니다";
/* OnboardingKey */
-"接上 Ling,用上完整的知了" = "Ling을 연결하고 Cicada를 온전히 쓰세요";
-"纪要、更准的翻译和自然的同传语音都靠它,约 1 分钟。" = "회의록, 더 정확한 번역, 자연스러운 통역 음성이 모두 Ling으로 동작합니다. 약 1분이면 됩니다.";
+"用其他服务" = "다른 서비스 사용";
+"纪要和翻译都能用,模型已经选好。" = "회의록과 번역을 모두 사용할 수 있으며, 모델이 이미 선택되어 있습니다.";
+"接上 Ling,一个 key 用上全部功能" = "Ling을 연결하여 하나의 key로 모든 기능 사용";
+"更准的翻译" = "더 정확한 번역";
+"自然的同传声音" = "자연스러운 동시통역 음성";
+"用你自己的声音" = "내 목소리 사용";
"Ling 每月赠送 ¥10 额度" = "Ling이 매달 ¥10 크레딧 제공";
"约够 10–50 小时会议" = "회의 약 10–50시간 분량";
+"‹ 还是用 Ling" = "‹ 그래도 Ling 사용";
+"用不了 Ling?" = "Ling을 사용할 수 없나요?";
+"粘贴 %@ 的 key" = "%@ key 붙여넣기";
+"打开 %@" = "%@ 열기";
+"这个 key 无效,请检查是否复制完整,或重新创建一个" = "이 key는 유효하지 않습니다. 전부 복사됐는지 확인하거나 새로 만드세요";
+"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "클립보드에 sk-로 시작하는 key가 없습니다. 먼저 %@에서 복사하세요.";
+"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "클립보드에 sk-로 시작하는 키가 없습니다. 먼저 Ling 플랫폼에서 복사하세요.";
+"只保存在这台 Mac 上,只发给 %@" = "이 Mac에만 저장되며 %@에만 전송됨";
+"少了:" = "제외된 기능:";
+"(只有 Ling 支持)" = "(Ling만 지원)";
+"自然的同传声音、你自己的声音" = "자연스러운 동시통역 음성, 내 목소리";
"在 Ling 开放平台创建 key" = "Ling 플랫폼에서 key 만들기";
-"注册或登录后点“创建令牌”" = "가입 또는 로그인 후 “Create Credential” 클릭";
+"国内直接注册,不用代理;登录后点“创建令牌”" = "중국 내에서 프록시 없이 직접 가입 가능. 로그인 후 '토큰 생성' 클릭";
"打开 Ling 开放平台" = "Ling 플랫폼 열기";
"复制 sk- 开头的 key,回来粘贴" = "sk-로 시작하는 키를 복사해 여기에 붙여넣기";
-"粘贴并检查" = "붙여넣고 확인";
-"这个 key 无效,请检查是否复制完整,或重新创建一个" = "이 key는 유효하지 않습니다. 전부 복사됐는지 확인하거나 새로 만드세요";
-"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "클립보드에 sk-로 시작하는 키가 없습니다. 먼저 Ling 플랫폼에서 복사하세요.";
-"只保存在这台 Mac 上,只发给 Ling" = "이 Mac에만 저장되고 Ling에만 전송됩니다";
"现在可以用了" = "이제 사용 가능";
"开会时,纪要会跟着字幕一起更新。" = "회의 중에는 회의록이 자막과 함께 업데이트됩니다.";
-"更准的翻译" = "더 정확한 번역";
"人名、术语前后一致" = "이름과 용어가 일관됨";
"自然人声" = "자연스러운 음성";
"同传约 2 秒出声" = "통역 약 2초 만에 음성 출력";
@@ -476,6 +539,7 @@
"接上 Ling 才有" = "Ling 연결 필요";
"实时纪要和会后总结" = "실시간 회의록과 회의 후 요약";
"自然人声,约 2 秒出声" = "자연스러운 음성, 약 2초 후 출력";
+"粘贴并检查" = "붙여넣고 확인";
"接上后继续" = "연결 후 계속";
"好,先这样" = "네, 일단 이대로";
"先不接" = "건너뛰기";
@@ -575,7 +639,6 @@
"切换显示方式" = "표시 방식 전환";
"被其他应用占用了,点右边换一个" = "다른 앱에서 사용 중입니다. 오른쪽을 클릭해 변경하세요";
"实时纪要 → 字幕条 → 不显示" = "실시간 회의록 → 자막 바 → 표시 안 함";
-"共享屏幕时让对方看到" = "화면 공유 시 상대에게 보이기";
"录屏也一样;关着时只有你看得到纪要窗口" = "녹화도 마찬가지입니다. 끄면 회의록 창은 나만 볼 수 있습니다";
"字幕条显示时机" = "자막 바 표시 시점";
"安静多久后收起" = "조용한 뒤 접기까지";
@@ -651,7 +714,7 @@
"麦克风峰值 %lld dB" = "마이크 최대 %lld dB";
"本机转写定稿" = "이 Mac에서 받아쓰기 확정";
"没有译文" = "번역 없음";
-"本机(Ming 未成功)" = "이 Mac (Ming 실패)";
+"本机(%@ 失败)" = "온디바이스 (%@ 실패)";
"本机声音" = "Mac 음성";
"只录到静音" = "무음만 녹음됨";
"录到 %@ 秒声音" = "%@초 분량의 소리 녹음";
@@ -735,8 +798,8 @@
"没能自动更新:%@。已打开下载页" = "자동 업데이트 실패: %@. 다운로드 페이지를 열었습니다";
"安装后自动重新打开" = "설치 후 자동으로 다시 열림";
"更新说明" = "릴리스 노트";
-"版本 %@" = "버전 %@";
"登录时打开" = "로그인 시 열기";
+"版本 %@" = "버전 %@";
"首次引导" = "시작 안내";
"请在“系统设置 › 通用 › 登录项”中允许" = "‘시스템 설정 › 일반 › 로그인 항목’에서 허용하세요";
"开机后在菜单栏待命,不弹窗口" = "메뉴 막대에서 대기하며 창을 띄우지 않음";
@@ -752,9 +815,6 @@
/* Updater */
"新版本需要 macOS %@ 或更新版本" = "새 버전은 macOS %@ 이상이 필요합니다";
-"在系统设置里打开后,要重新打开知了" = "시스템 설정에서 켠 뒤 Cicada를 다시 열어 주세요";
-"重新打开" = "다시 열기";
-"请在系统设置里允许“系统音频录制”,再重新打开知了" = "시스템 설정에서 ‘시스템 오디오 녹음’을 허용한 뒤 Cicada를 다시 열어 주세요";
"下载的不是预期的版本" = "다운로드한 파일이 예상한 버전이 아닙니다";
"下载的文件校验不通过" = "다운로드한 파일의 체크섬이 일치하지 않습니다";
"请先把应用拖进“应用程序”文件夹" = "먼저 앱을 ‘응용 프로그램’ 폴더로 옮기세요";
@@ -784,11 +844,11 @@
"系统麦克风还是 %@" = "시스템 마이크가 아직 %@예요";
"别的软件现在听不到你说话" = "다른 앱에 내 목소리가 들리지 않아요";
"跟随系统的网页听不到译文" = "기본 마이크를 쓰는 페이지엔 번역이 안 들려요";
-"导入文件…" = "가져오기…";
-"再点收起" = "다시 눌러 숨기기";
-"再点打开" = "다시 눌러 열기";
"显示方式" = "표시 방식";
"轮换" = "로 전환";
+"再点收起" = "다시 눌러 숨기기";
+"再点打开" = "다시 눌러 열기";
+"导入文件…" = "가져오기…";
"在会议室里开会?" = "회의실에서 회의 중인가요?";
"电脑里 1 分钟没放出声音" = "1분 동안 Mac에서 소리가 나지 않았어요";
"改听会议室" = "회의실 듣기";
@@ -796,8 +856,8 @@
"后台转写 %@ · %lld%%" = "%@ 받아쓰는 중 · %lld%%";
"后台转写 %@ · %lld%%,还有 %lld 个" = "%@ 받아쓰는 중 · %lld%%, %lld개 남음";
"屏幕上不出字幕,文字记录照常保存" = "화면에는 표시하지 않고, 대화 기록은 그대로 저장됩니다";
-"什么时候出现" = "표시 시점";
"填入 API key 后可生成纪要;文字记录照常保存" = "API key를 입력하면 회의록을 작성할 수 있으며, 대화 기록은 그대로 저장됩니다";
+"什么时候出现" = "표시 시점";
"译文从扬声器念出来" = "번역은 스피커로 읽어 줘요";
"系统麦克风换成 %@" = "시스템 마이크를 %@(으)로 전환";
"译文送进 %@" = "번역을 %@(으)로 보냅니다";
@@ -867,19 +927,25 @@
"从这里播放" = "여기서부터 재생";
"正在整理纪要…" = "회의록 작성 중…";
"纪要会在会议进行中自动生成" = "회의록은 회의 중에 자동으로 작성됩니다";
-"使用 Ling 将文字记录整理为总结、议题、结论和人名,约需半分钟。" = "Ling이 대화 기록을 요약, 안건, 결론, 인명으로 정리합니다. 약 30초 걸립니다.";
+"用 %@ 整理出总结、议题、结论和人名,约半分钟。" = "%@(으)로 요약, 안건, 결론, 인명을 약 30초 만에 정리합니다.";
"前往 设置 › AI 服务 填入 Ling 的 API key 后即可生成。" = "설정 › AI 서비스에서 Ling API key를 입력하면 작성할 수 있습니다.";
"正在生成…" = "작성 중…";
"生成纪要" = "회의록 작성";
"去填 key" = "key 입력";
+"听着不像 %@" = "%@ 같지 않아요";
+"听着不像 %@ 或 %@" = "%@도 %@도 아닌 것 같아요";
+"听着不像已装的语言" = "설치된 언어가 아닌 것 같아요";
"听不出是哪种语言,你来选一下" = "어떤 언어인지 알 수 없어요. 골라 주세요";
"更多…" = "더 보기…";
"正在补装 %@ 语音模型,装好后自动判断语言" = "%@ 음성 모델을 추가하는 중. 추가되면 언어를 자동으로 감지해요";
+"选了就下载它的语音模型,开头这段也会补上" = "고르면 음성 모델을 내려받고, 앞부분도 채워 넣어요";
+"其实是:" = "사실은:";
"网络连不上,连上后会自动继续" = "네트워크에 연결할 수 없어요. 연결되면 자동으로 계속해요";
"这台 Mac 的磁盘空间不够了" = "이 Mac의 디스크 공간이 부족해요";
"这台 Mac 上的语音模型已满 5 种" = "이 Mac의 음성 모델이 최대 5개에 도달했어요";
"先用已装的:" = "설치된 언어로 계속:";
"打开存储空间" = "저장 공간 열기";
+"打开听写设置" = "받아쓰기 설정 열기";
/* VirtualMic */
"%@要安装虚拟麦克风,让会议里的人听到你的翻译。" = "%@이(가) 가상 마이크를 설치하려 합니다. 회의 참석자가 내 번역을 들을 수 있게 하기 위해서입니다.";
@@ -890,23 +956,27 @@
"%@要让系统认出虚拟麦克风,声音会断约 1 秒。" = "%@이(가) 시스템에 가상 마이크를 인식시키는 동안 소리가 약 1초간 끊깁니다.";
/* VoicePicker */
-"声音" = "목소리";
"选择对方听到的声音" = "상대가 들을 목소리 선택";
"试听" = "미리 듣기";
"系统声音" = "시스템 음성";
"你的音色" = "내 음색";
"填入 Ling key:声音更自然,还能用你自己的声音" = "Ling key를 넣으면 더 자연스러운 음성과 내 목소리를 쓸 수 있습니다";
+"填好 AI 服务的 key,声音更自然" = "AI 서비스 key를 입력하면 음성이 더 자연스러워집니다";
"去填写" = "입력하기";
"每种语言各记一个声音" = "언어마다 목소리를 기억합니다";
"对方说%@时用" = "상대가 %@일 때 사용";
"(当前)" = " (현재)";
+"%@ 用不了时,自动换本机声音" = "%@ 사용 불가 시 자동으로 온디바이스 음성으로 전환";
+"这个服务不出声音,用本机声音" = "이 서비스는 음성을 지원하지 않아 온디바이스 음성 사용";
"Ling 不可用时自动换成本机声音" = "Ling을 쓸 수 없으면 Mac 음성으로 바뀝니다";
"填入 Ling key 后可用 Ming 声音和你自己的声音" = "Ling key가 있으면 Ming 음성과 내 목소리를 쓸 수 있습니다";
"慢约 1 秒" = "약 1초 느림";
"最快" = "가장 빠름";
+"去换成 Ling" = "Ling으로 전환";
+"我自己的声音" = "내 목소리";
+"只有 Ling 能用你自己的声音" = "Ling에서만 내 목소리를 사용할 수 있습니다";
"用我自己的声音" = "내 목소리 사용";
"录制" = "녹음";
-"我自己的声音" = "내 목소리";
"录 15 秒原声,对方听到你的音色,晚约 3 秒" = "15초 녹음하면 상대가 내 음색으로 듣습니다(약 3초 지연)";
"已录 %lld 秒 · %@" = "%lld초 녹음됨 · %@";
"重录" = "다시 녹음";
@@ -930,10 +1000,8 @@
"用这个声音" = "이 음성 사용";
/* Voices */
-"女" = "여성";
"美式" = "미국식";
"自然对话" = "자연스러운 대화";
-"男" = "남성";
"英式" = "영국식";
"稳重" = "안정적";
"平稳" = "평온";
@@ -952,9 +1020,3 @@
"无法打开麦克风:%@" = "마이크를 열 수 없습니다: %@";
"录音太短了,请至少朗读 %lld 秒" = "녹음이 너무 짧습니다. 최소 %lld초 이상 읽어 주세요";
"没听清录音内容,请换个安静的地方再录一次" = "녹음 내용을 알아듣지 못했습니다. 조용한 곳에서 다시 녹음하세요";
-"听着不像 %@" = "%@ 같지 않아요";
-"听着不像 %@ 或 %@" = "%@도 %@도 아닌 것 같아요";
-"听着不像已装的语言" = "설치된 언어가 아닌 것 같아요";
-"选了就下载它的语音模型,开头这段也会补上" = "고르면 음성 모델을 내려받고, 앞부분도 채워 넣어요";
-"其实是:" = "사실은:";
-"打开听写设置" = "받아쓰기 설정 열기";
diff --git a/Resources/zh-Hans.lproj/Localizable.strings b/Resources/zh-Hans.lproj/Localizable.strings
index e9fdb14..dc8ccdb 100644
--- a/Resources/zh-Hans.lproj/Localizable.strings
+++ b/Resources/zh-Hans.lproj/Localizable.strings
@@ -1,40 +1,85 @@
+/* AIProviders */
+"更准" = "更准";
+"更快、更省" = "更快、更省";
+"女" = "女";
+"男" = "男";
+"和 Ling 同款" = "和 Ling 同款";
+"中文好" = "中文好";
+"效果和价格最均衡" = "效果和价格最均衡";
+"更省" = "更省";
+"够用、更省" = "够用、更省";
+"自定义服务" = "自定义服务";
+
/* AISettings */
-"用在哪里" = "用在哪里";
-"一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。" = "一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。";
+"其他(兼容 OpenAI)" = "其他(兼容 OpenAI)";
+"现在能用的" = "现在能用的";
+"用 %@" = "用 %@";
"实时纪要" = "实时纪要";
-"用 Ling" = "用 Ling";
"需要 key" = "需要 key";
"会中每 45 秒更新" = "会中每 45 秒更新";
"填好 key 后可用" = "填好 key 后可用";
"翻译" = "翻译";
-"整句用 Ling;不行时换 Google、本机" = "整句用 Ling;不行时换 Google、本机";
-"整句用 Ling;不行时换 Google" = "整句用 Ling;不行时换 Google";
+"整句用它;不行时换 Google、本机" = "整句用它;不行时换 Google、本机";
+"整句用它;不行时换 Google" = "整句用它;不行时换 Google";
"没有 key 时照常可用" = "没有 key 时照常可用";
-"语音识别" = "语音识别";
+"同传声音" = "同传声音";
"本机" = "本机";
+"你自己的声音" = "你自己的声音";
+"录一段,让对方听到你的音色" = "录一段,让对方听到你的音色";
+"只有 Ling" = "只有 Ling";
+"换用 Ling 才有" = "换用 Ling 才有";
+"语音识别" = "语音识别";
"更快,不花钱" = "更快,不花钱";
-"同声传译的声音" = "同声传译的声音";
-"Ming 的声音或你自己的声音" = "Ming 的声音或你自己的声音";
-"没有 key 时用本机声音" = "没有 key 时用本机声音";
-"去选声音" = "去选声音";
+"自己选模型" = "自己选模型";
"模型" = "模型";
"3.1 更准;3.0 更快、更省" = "3.1 更准;3.0 更快、更省";
-"在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。" = "在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。";
-"打开 Ling 开放平台 ↗" = "打开 Ling 开放平台 ↗";
+"文字模型" = "文字模型";
+"纪要和整句翻译" = "纪要和整句翻译";
+"声音模型" = "声音模型";
+"同传念给对方" = "同传念给对方";
+"一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。" = "一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。";
+"按所选模型计费。发出去的只有文字,语音识别留在本机。" = "按所选模型计费。发出去的只有文字,语音识别留在本机。";
+"在 %@ 创建 key,复制后粘贴到这里。" = "在 %@ 创建 key,复制后粘贴到这里。";
+"打开 %@ ↗" = "打开 %@ ↗";
+"还没填好" = "还没填好";
"还没填 API key" = "还没填 API key";
"正在检查…" = "正在检查…";
"已连接" = "已连接";
"这个 key 用不了" = "这个 key 用不了";
"暂时连不上" = "暂时连不上";
"%@ · 响应约 %@ 秒" = "%@ · 响应约 %@ 秒";
-"Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个" = "Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个";
+"%@ 提示 key 无效,请检查是否复制完整,或重新创建一个" = "%@ 提示 key 无效,请检查是否复制完整,或重新创建一个";
"不填 key 时,字幕和翻译仍可正常使用" = "不填 key 时,字幕和翻译仍可正常使用";
"更换" = "更换";
"重试" = "重试";
"保存并检查" = "保存并检查";
"取消" = "取消";
-"只存在这台 Mac 上(只有你的账户能读),只发给 Ling(ant-ling.com)" = "只存在这台 Mac 上(只有你的账户能读),只发给 Ling(ant-ling.com)";
+"本机服务可不填" = "本机服务可不填";
"移除" = "移除";
+"只存在这台 Mac 上(只有你的账户能读),只发给 %@" = "只存在这台 Mac 上(只有你的账户能读),只发给 %@";
+"只存在这台 Mac 上(只有你的账户能读),只发给 %@(%@)" = "只存在这台 Mac 上(只有你的账户能读),只发给 %@(%@)";
+"地址需用 https,仅 localhost 可用 http。" = "地址需用 https,仅 localhost 可用 http。";
+"地址" = "地址";
+"例如 qwen3:14b" = "例如 qwen3:14b";
+"你填的地址" = "你填的地址";
+"Ming 的声音" = "Ming 的声音";
+"没有 key 时用本机声音" = "没有 key 时用本机声音";
+"没填声音模型,用本机声音" = "没填声音模型,用本机声音";
+"%@ 暂不能出声音,用本机声音" = "%@ 暂不能出声音,用本机声音";
+"声音(可选)" = "声音(可选)";
+"需支持 /audio/speech;不填则用本机声音。" = "需支持 /audio/speech;不填则用本机声音。";
+"例如 kokoro" = "例如 kokoro";
+"声音" = "声音";
+"例如 af_heart" = "例如 af_heart";
+"跟上面一样" = "跟上面一样";
+"(推荐)" = "(推荐)";
+"模型名" = "模型名";
+"好" = "好";
+"推荐" = "推荐";
+"全部 %lld 个" = "全部 %lld 个";
+"填其他模型名…" = "填其他模型名…";
+"其他" = "其他";
+"选一个" = "选一个";
/* AboutPanel */
"把 Mac 正在播放的声音变成实时双语字幕和会议纪要" = "把 Mac 正在播放的声音变成实时双语字幕和会议纪要";
@@ -228,7 +273,11 @@
"会议原文" = "会议原文";
/* Ling */
-"连不上 Ling,检查网络或代理" = "连不上 Ling,检查网络或代理";
+"这个服务" = "这个服务";
+"找不到模型,或地址不对(HTTP %lld)" = "找不到模型,或地址不对(HTTP %lld)";
+"%@ 拒绝了请求(HTTP %lld),请检查模型名" = "%@ 拒绝了请求(HTTP %lld),请检查模型名";
+"连不上 %@,请检查网络或代理" = "连不上 %@,请检查网络或代理";
+"这个服务不支持 JSON(HTTP %lld),纪要用不了" = "这个服务不支持 JSON(HTTP %lld),纪要用不了";
/* ListenEngine */
"%@(识别中…)→ %@" = "%@(识别中…)→ %@";
@@ -236,6 +285,7 @@
"等你允许使用麦克风" = "等你允许使用麦克风";
"正在听" = "正在听";
"此 Mac 不支持本机语音识别" = "此 Mac 不支持本机语音识别";
+"请在系统设置里允许“系统音频录制”,再重新打开知了" = "请在系统设置里允许“系统音频录制”,再重新打开知了";
"无法读取系统音频,请在系统设置里允许“系统音频录制”" = "无法读取系统音频,请在系统设置里允许“系统音频录制”";
"没能下载 %@ 语音模型" = "没能下载 %@ 语音模型";
"已暂停" = "已暂停";
@@ -333,12 +383,13 @@
"%lld 分钟前更新" = "%lld 分钟前更新";
"这场会议的语言" = "这场会议的语言";
"整理中" = "整理中";
+"共享屏幕时让对方看到" = "共享屏幕时让对方看到";
"对方可见" = "对方可见";
"仅自己可见" = "仅自己可见";
-"对方可见 · 点击关闭" = "对方可见 · 点击关闭";
-"仅自己可见 · 点击共享" = "仅自己可见 · 点击共享";
"文字记录 · %lld" = "文字记录 · %lld";
"文字记录" = "文字记录";
+"对方可见 · 点击关闭" = "对方可见 · 点击关闭";
+"仅自己可见 · 点击共享" = "仅自己可见 · 点击共享";
"在文字记录中搜索 ⌘F" = "在文字记录中搜索 ⌘F";
"无结果" = "无结果";
"上一个" = "上一个";
@@ -365,8 +416,8 @@
"开始新会议" = "开始新会议";
"更换 key" = "更换 key";
"生成纪要需要 API key" = "生成纪要需要 API key";
-"文字记录仍在正常保存。填入 Ling 的 key 后,会从头开始整理整场会议的内容。" = "文字记录仍在正常保存。填入 Ling 的 key 后,会从头开始整理整场会议的内容。";
-"获取 Ling key ↗" = "获取 Ling key ↗";
+"文字记录仍在保存。填好 %@ 的 key 后,会从头整理出整场纪要。" = "文字记录仍在保存。填好 %@ 的 key 后,会从头整理出整场纪要。";
+"获取 %@ key ↗" = "获取 %@ key ↗";
"保存并开始" = "保存并开始";
"没有进行中的会议" = "没有进行中的会议";
"这场会议还没有纪要" = "这场会议还没有纪要";
@@ -408,11 +459,13 @@
"字幕和纪要都从这里来。去系统设置打开,回来会自动识别。" = "字幕和纪要都从这里来。去系统设置打开,回来会自动识别。";
"声音只在本机识别" = "声音只在本机识别";
"听电脑里的声音" = "听电脑里的声音";
+"在系统设置里打开后,要重新打开知了" = "在系统设置里打开后,要重新打开知了";
"只听声音,不录屏幕画面" = "只听声音,不录屏幕画面";
"识别语音" = "识别语音";
"打开“听写”,允许“语音识别”" = "打开“听写”,允许“语音识别”";
"已打开" = "已打开";
"去开启" = "去开启";
+"重新打开" = "重新打开";
"放一段会议试试" = "放一段会议试试";
"一段 9 秒的英文会议,字幕会跟着声音实时出来。" = "一段 9 秒的英文会议,字幕会跟着声音实时出来。";
"听到" = "听到";
@@ -449,21 +502,31 @@
"下一步接上 Ling 就有" = "下一步接上 Ling 就有";
/* OnboardingKey */
-"接上 Ling,用上完整的知了" = "接上 Ling,用上完整的知了";
-"纪要、更准的翻译和自然的同传语音都靠它,约 1 分钟。" = "纪要、更准的翻译和自然的同传语音都靠它,约 1 分钟。";
+"用其他服务" = "用其他服务";
+"纪要和翻译都能用,模型已经选好。" = "纪要和翻译都能用,模型已经选好。";
+"接上 Ling,一个 key 用上全部功能" = "接上 Ling,一个 key 用上全部功能";
+"更准的翻译" = "更准的翻译";
+"自然的同传声音" = "自然的同传声音";
+"用你自己的声音" = "用你自己的声音";
"Ling 每月赠送 ¥10 额度" = "Ling 每月赠送 ¥10 额度";
"约够 10–50 小时会议" = "约够 10–50 小时会议";
+"‹ 还是用 Ling" = "‹ 还是用 Ling";
+"用不了 Ling?" = "用不了 Ling?";
+"粘贴 %@ 的 key" = "粘贴 %@ 的 key";
+"打开 %@" = "打开 %@";
+"这个 key 无效,请检查是否复制完整,或重新创建一个" = "这个 key 无效,请检查是否复制完整,或重新创建一个";
+"剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。" = "剪贴板里没有 sk- 开头的 key,请先去 %@ 复制。";
+"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。";
+"只保存在这台 Mac 上,只发给 %@" = "只保存在这台 Mac 上,只发给 %@";
+"少了:" = "少了:";
+"(只有 Ling 支持)" = "(只有 Ling 支持)";
+"自然的同传声音、你自己的声音" = "自然的同传声音、你自己的声音";
"在 Ling 开放平台创建 key" = "在 Ling 开放平台创建 key";
-"注册或登录后点“创建令牌”" = "注册或登录后点“创建令牌”";
+"国内直接注册,不用代理;登录后点“创建令牌”" = "国内直接注册,不用代理;登录后点“创建令牌”";
"打开 Ling 开放平台" = "打开 Ling 开放平台";
"复制 sk- 开头的 key,回来粘贴" = "复制 sk- 开头的 key,回来粘贴";
-"粘贴并检查" = "粘贴并检查";
-"这个 key 无效,请检查是否复制完整,或重新创建一个" = "这个 key 无效,请检查是否复制完整,或重新创建一个";
-"剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。" = "剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。";
-"只保存在这台 Mac 上,只发给 Ling" = "只保存在这台 Mac 上,只发给 Ling";
"现在可以用了" = "现在可以用了";
"开会时,纪要会跟着字幕一起更新。" = "开会时,纪要会跟着字幕一起更新。";
-"更准的翻译" = "更准的翻译";
"人名、术语前后一致" = "人名、术语前后一致";
"自然人声" = "自然人声";
"同传约 2 秒出声" = "同传约 2 秒出声";
@@ -476,6 +539,7 @@
"接上 Ling 才有" = "接上 Ling 才有";
"实时纪要和会后总结" = "实时纪要和会后总结";
"自然人声,约 2 秒出声" = "自然人声,约 2 秒出声";
+"粘贴并检查" = "粘贴并检查";
"接上后继续" = "接上后继续";
"好,先这样" = "好,先这样";
"先不接" = "先不接";
@@ -490,7 +554,7 @@
"请在系统设置 › 键盘里打开“听写”" = "请在系统设置 › 键盘里打开“听写”";
"请在系统设置里允许知了使用“语音识别”" = "请在系统设置里允许知了使用“语音识别”";
"本机不支持%@识别" = "本机不支持%@识别";
-"请在系统设置 › 键盘 › 听写里添加%@" = "请在系统设置 › 键盘 › 听写里添加%@";
+"请在系统设置 › 键盘 › 听写里添加%@,下载好后可用" = "请在系统设置 › 键盘 › 听写里添加%@,下载好后可用";
/* RoomMic */
"没有可用的麦克风" = "没有可用的麦克风";
@@ -575,7 +639,6 @@
"切换显示方式" = "切换显示方式";
"被其他应用占用了,点右边换一个" = "被其他应用占用了,点右边换一个";
"实时纪要 → 字幕条 → 不显示" = "实时纪要 → 字幕条 → 不显示";
-"共享屏幕时让对方看到" = "共享屏幕时让对方看到";
"录屏也一样;关着时只有你看得到纪要窗口" = "录屏也一样;关着时只有你看得到纪要窗口";
"字幕条显示时机" = "字幕条显示时机";
"安静多久后收起" = "安静多久后收起";
@@ -651,7 +714,7 @@
"麦克风峰值 %lld dB" = "麦克风峰值 %lld dB";
"本机转写定稿" = "本机转写定稿";
"没有译文" = "没有译文";
-"本机(Ming 未成功)" = "本机(Ming 未成功)";
+"本机(%@ 失败)" = "本机(%@ 失败)";
"本机声音" = "本机声音";
"只录到静音" = "只录到静音";
"录到 %@ 秒声音" = "录到 %@ 秒声音";
@@ -735,8 +798,8 @@
"没能自动更新:%@。已打开下载页" = "没能自动更新:%@。已打开下载页";
"安装后自动重新打开" = "安装后自动重新打开";
"更新说明" = "更新说明";
-"版本 %@" = "版本 %@";
"登录时打开" = "登录时打开";
+"版本 %@" = "版本 %@";
"首次引导" = "首次引导";
"请在“系统设置 › 通用 › 登录项”中允许" = "请在“系统设置 › 通用 › 登录项”中允许";
"开机后在菜单栏待命,不弹窗口" = "开机后在菜单栏待命,不弹窗口";
@@ -781,11 +844,11 @@
"系统麦克风还是 %@" = "系统麦克风还是 %@";
"别的软件现在听不到你说话" = "别的软件现在听不到你说话";
"跟随系统的网页听不到译文" = "跟随系统的网页听不到译文";
-"导入文件…" = "导入文件…";
-"再点收起" = "再点收起";
-"再点打开" = "再点打开";
"显示方式" = "显示方式";
"轮换" = "轮换";
+"再点收起" = "再点收起";
+"再点打开" = "再点打开";
+"导入文件…" = "导入文件…";
"在会议室里开会?" = "在会议室里开会?";
"电脑里 1 分钟没放出声音" = "电脑里 1 分钟没放出声音";
"改听会议室" = "改听会议室";
@@ -793,8 +856,8 @@
"后台转写 %@ · %lld%%" = "后台转写 %@ · %lld%%";
"后台转写 %@ · %lld%%,还有 %lld 个" = "后台转写 %@ · %lld%%,还有 %lld 个";
"屏幕上不出字幕,文字记录照常保存" = "屏幕上不出字幕,文字记录照常保存";
-"什么时候出现" = "什么时候出现";
"填入 API key 后可生成纪要;文字记录照常保存" = "填入 API key 后可生成纪要;文字记录照常保存";
+"什么时候出现" = "什么时候出现";
"译文从扬声器念出来" = "译文从扬声器念出来";
"系统麦克风换成 %@" = "系统麦克风换成 %@";
"译文送进 %@" = "译文送进 %@";
@@ -864,19 +927,25 @@
"从这里播放" = "从这里播放";
"正在整理纪要…" = "正在整理纪要…";
"纪要会在会议进行中自动生成" = "纪要会在会议进行中自动生成";
-"使用 Ling 将文字记录整理为总结、议题、结论和人名,约需半分钟。" = "使用 Ling 将文字记录整理为总结、议题、结论和人名,约需半分钟。";
+"用 %@ 整理出总结、议题、结论和人名,约半分钟。" = "用 %@ 整理出总结、议题、结论和人名,约半分钟。";
"前往 设置 › AI 服务 填入 Ling 的 API key 后即可生成。" = "前往 设置 › AI 服务 填入 Ling 的 API key 后即可生成。";
"正在生成…" = "正在生成…";
"生成纪要" = "生成纪要";
"去填 key" = "去填 key";
+"听着不像 %@" = "听着不像 %@";
+"听着不像 %@ 或 %@" = "听着不像 %@ 或 %@";
+"听着不像已装的语言" = "听着不像已装的语言";
"听不出是哪种语言,你来选一下" = "听不出是哪种语言,你来选一下";
"更多…" = "更多…";
"正在补装 %@ 语音模型,装好后自动判断语言" = "正在补装 %@ 语音模型,装好后自动判断语言";
+"选了就下载它的语音模型,开头这段也会补上" = "选了就下载它的语音模型,开头这段也会补上";
+"其实是:" = "其实是:";
"网络连不上,连上后会自动继续" = "网络连不上,连上后会自动继续";
"这台 Mac 的磁盘空间不够了" = "这台 Mac 的磁盘空间不够了";
"这台 Mac 上的语音模型已满 5 种" = "这台 Mac 上的语音模型已满 5 种";
"先用已装的:" = "先用已装的:";
"打开存储空间" = "打开存储空间";
+"打开听写设置" = "打开听写设置";
/* VirtualMic */
"%@要安装虚拟麦克风,让会议里的人听到你的翻译。" = "%@要安装虚拟麦克风,让会议里的人听到你的翻译。";
@@ -887,23 +956,27 @@
"%@要让系统认出虚拟麦克风,声音会断约 1 秒。" = "%@要让系统认出虚拟麦克风,声音会断约 1 秒。";
/* VoicePicker */
-"声音" = "声音";
"选择对方听到的声音" = "选择对方听到的声音";
"试听" = "试听";
"系统声音" = "系统声音";
"你的音色" = "你的音色";
"填入 Ling key:声音更自然,还能用你自己的声音" = "填入 Ling key:声音更自然,还能用你自己的声音";
+"填好 AI 服务的 key,声音更自然" = "填好 AI 服务的 key,声音更自然";
"去填写" = "去填写";
"每种语言各记一个声音" = "每种语言各记一个声音";
"对方说%@时用" = "对方说%@时用";
"(当前)" = "(当前)";
+"%@ 用不了时,自动换本机声音" = "%@ 用不了时,自动换本机声音";
+"这个服务不出声音,用本机声音" = "这个服务不出声音,用本机声音";
"Ling 不可用时自动换成本机声音" = "Ling 不可用时自动换成本机声音";
"填入 Ling key 后可用 Ming 声音和你自己的声音" = "填入 Ling key 后可用 Ming 声音和你自己的声音";
"慢约 1 秒" = "慢约 1 秒";
"最快" = "最快";
+"去换成 Ling" = "去换成 Ling";
+"我自己的声音" = "我自己的声音";
+"只有 Ling 能用你自己的声音" = "只有 Ling 能用你自己的声音";
"用我自己的声音" = "用我自己的声音";
"录制" = "录制";
-"我自己的声音" = "我自己的声音";
"录 15 秒原声,对方听到你的音色,晚约 3 秒" = "录 15 秒原声,对方听到你的音色,晚约 3 秒";
"已录 %lld 秒 · %@" = "已录 %lld 秒 · %@";
"重录" = "重录";
@@ -927,10 +1000,8 @@
"用这个声音" = "用这个声音";
/* Voices */
-"女" = "女";
"美式" = "美式";
"自然对话" = "自然对话";
-"男" = "男";
"英式" = "英式";
"稳重" = "稳重";
"平稳" = "平稳";
@@ -949,9 +1020,3 @@
"无法打开麦克风:%@" = "无法打开麦克风:%@";
"录音太短了,请至少朗读 %lld 秒" = "录音太短了,请至少朗读 %lld 秒";
"没听清录音内容,请换个安静的地方再录一次" = "没听清录音内容,请换个安静的地方再录一次";
-"听着不像 %@" = "听着不像 %@";
-"听着不像 %@ 或 %@" = "听着不像 %@ 或 %@";
-"听着不像已装的语言" = "听着不像已装的语言";
-"选了就下载它的语音模型,开头这段也会补上" = "选了就下载它的语音模型,开头这段也会补上";
-"其实是:" = "其实是:";
-"打开听写设置" = "打开听写设置";
diff --git a/Sources/LiveSubs/AIProviders.swift b/Sources/LiveSubs/AIProviders.swift
new file mode 100644
index 0000000..f02b116
--- /dev/null
+++ b/Sources/LiveSubs/AIProviders.swift
@@ -0,0 +1,172 @@
+import Foundation
+
+/// The AI services the app can use. Ling is the reference (everything works, prompts are tuned on
+/// it); the others are OpenAI-compatible and cover text, and some of them voices. Only Ling clones
+/// the user's voice and hears audio (Ming), so with any other service speak-back hears on this Mac
+/// and translates the text.
+///
+/// Recommended models come first in every menu and are the defaults: good enough, then cheapest,
+/// Chinese first, no reasoning (measured 2026-11: OpenRouter / ZenMux catalogs, Artificial Analysis
+/// TTS arena). `inclusionai/ling-*` is Ling itself on the aggregators, so the prompts carry over.
+struct AIProvider: Identifiable, Equatable {
+ enum Kind: String, CaseIterable, Identifiable {
+ case ling, openrouter, zenmux, openai, custom
+ var id: String { rawValue }
+ }
+
+ struct Model: Equatable {
+ let id: String
+ /// Why it is recommended, a short UI line.
+ let note: String
+ }
+
+ let id: Kind
+ let name: String
+ /// nil for `custom`: the user's address.
+ let base: URL?
+ /// Where to create a key.
+ let site: URL?
+ let textModels: [Model]
+ /// Empty: this service has no voices here, the room hears the Mac's.
+ let voiceModels: [Model]
+ /// Voices of `voiceModels` (all Gemini TTS: the same names in every language).
+ let voices: [CloudVoice]
+ let clones: Bool
+ let hearsAudio: Bool
+ /// Ling's account allows ~2 requests per second across every model; the aggregators allow far more.
+ let spacing: TimeInterval
+
+ var hasVoices: Bool { !voiceModels.isEmpty }
+
+ static let ling = AIProvider(
+ id: .ling, name: "Ling", base: URL(string: "https://api.ant-ling.com/v1/"),
+ site: URL(string: "https://chat.ant-ling.com/platform/api"),
+ textModels: [Model(id: "Ling-3.1-flash", note: L("更准")), Model(id: "Ling-3.0-flash", note: L("更快、更省"))],
+ voiceModels: [Model(id: "Ming-3.0-tts-0.5B", note: "")], voices: [],
+ clones: true, hearsAudio: true, spacing: 0.6)
+
+ static let gemini: [CloudVoice] = [
+ CloudVoice(id: "Kore", gender: L("女")), CloudVoice(id: "Aoede", gender: L("女")),
+ CloudVoice(id: "Charon", gender: L("男")), CloudVoice(id: "Puck", gender: L("男")),
+ ]
+
+ static let openrouter = AIProvider(
+ id: .openrouter, name: "OpenRouter", base: URL(string: "https://openrouter.ai/api/v1/"),
+ site: URL(string: "https://openrouter.ai/settings/keys"),
+ textModels: [Model(id: "inclusionai/ling-3.1-flash", note: L("和 Ling 同款")),
+ Model(id: "qwen/qwen3.8-flash", note: L("中文好"))],
+ voiceModels: [Model(id: "google/gemini-3.8-flash-tts", note: L("效果和价格最均衡")),
+ Model(id: "google/gemini-3.8-flash-lite-tts", note: L("更省"))],
+ voices: gemini, clones: false, hearsAudio: false, spacing: 0.1)
+
+ static let zenmux = AIProvider(
+ id: .zenmux, name: "ZenMux", base: URL(string: "https://zenmux.ai/api/v1/"),
+ site: URL(string: "https://zenmux.ai/settings/keys"),
+ textModels: [Model(id: "inclusionai/ling-3.0-flash", note: L("和 Ling 同款")),
+ Model(id: "qwen/qwen3.8-flash", note: L("中文好"))],
+ voiceModels: [Model(id: "google/gemini-3.8-flash-tts", note: L("效果和价格最均衡")),
+ Model(id: "google/gemini-3.8-flash-lite-tts", note: L("更省"))],
+ voices: gemini, clones: false, hearsAudio: false, spacing: 0.1)
+
+ /// No voices: `/audio/speech` models shut down 2027-01-06 and their successor is Realtime-only.
+ static let openai = AIProvider(
+ id: .openai, name: "OpenAI", base: URL(string: "https://api.openai.com/v1/"),
+ site: URL(string: "https://platform.openai.com/api-keys"),
+ textModels: [Model(id: "gpt-5.4-nano", note: L("够用、更省"))],
+ voiceModels: [], voices: [], clones: false, hearsAudio: false, spacing: 0.1)
+
+ /// Any OpenAI-compatible address (a company gateway, Ollama, LM Studio…). Voices only when the
+ /// user names a speech model; plain standard requests, none of Ling's workarounds.
+ static let custom = AIProvider(
+ id: .custom, name: L("自定义服务"), base: nil, site: nil,
+ textModels: [], voiceModels: [], voices: [], clones: false, hearsAudio: false, spacing: 0.1)
+
+ static let all: [AIProvider] = [.ling, .openrouter, .zenmux, .openai, .custom]
+
+ static func named(_ raw: String) -> AIProvider { all.first { $0.id.rawValue == raw } ?? .ling }
+
+ /// http only on this Mac (Ollama, LM Studio); anything else must be https.
+ static func customBase(_ raw: String) -> URL? {
+ var s = raw.trimmingCharacters(in: .whitespacesAndNewlines)
+ guard !s.isEmpty else { return nil }
+ if !s.contains("://") { s = (isLocal(s) ? "http://" : "https://") + s }
+ if !s.hasSuffix("/") { s += "/" }
+ guard let url = URL(string: s), let host = url.host, !host.isEmpty else { return nil }
+ if url.scheme == "https" { return url }
+ return url.scheme == "http" && isLocal(host) ? url : nil
+ }
+
+ static func isLocal(_ hostOrURL: String) -> Bool {
+ let host = URL(string: hostOrURL.contains("://") ? hostOrURL : "http://" + hostOrURL)?.host ?? hostOrURL
+ return ["localhost", "127.0.0.1", "::1"].contains(host)
+ }
+}
+
+/// A built-in voice of a cloud speech model.
+struct CloudVoice: Equatable {
+ let id: String
+ /// "女" / "男", localized.
+ let gender: String
+}
+
+/// What one call needs to know about the service in use, resolved from settings each time.
+struct AIConfig: Equatable {
+ var provider: AIProvider
+ /// nil: a custom service without a valid address yet.
+ var base: URL?
+ var textModel: String
+ /// nil: no voices with this service (the Mac's speak).
+ var voiceModel: String?
+ var voiceBase: URL?
+ /// The voice a custom speech model speaks with (others pick per language).
+ var customVoice: String?
+
+ var hasVoices: Bool { voiceModel != nil && voiceBase != nil }
+
+ /// The voices the room can pick from with this service.
+ var voices: [CloudVoice] {
+ guard hasVoices else { return [] }
+ if provider.id == .custom { return customVoice.map { [CloudVoice(id: $0, gender: "")] } ?? [] }
+ return provider.voices
+ }
+
+ /// The request body, shaped for the service: each one turns thinking off its own way, and
+ /// OpenAI's current models take neither `max_tokens` nor a temperature.
+ func shape(_ body: inout [String: Any], maxTokens: Int) {
+ switch provider.id {
+ case .ling:
+ body["max_tokens"] = maxTokens
+ body["temperature"] = 0.2
+ body["thinking"] = ["type": "disabled"]
+ case .openrouter, .zenmux:
+ body["max_tokens"] = maxTokens
+ body["temperature"] = 0.2
+ body["reasoning"] = ["enabled": false]
+ case .openai:
+ body["max_completion_tokens"] = maxTokens
+ body["reasoning_effort"] = "none"
+ case .custom:
+ body["max_tokens"] = maxTokens
+ body["temperature"] = 0.2
+ }
+ }
+
+ /// Text models from a `/models` reply, recommended ones first. Leaves out what cannot chat
+ /// (speech, transcription, images, embeddings) when the service says so, or by name for OpenAI.
+ static func textModels(fromCatalog data: Data, recommended: [String]) -> [String] {
+ guard let root = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
+ let list = root["data"] as? [[String: Any]] else { return recommended }
+ var ids: [String] = []
+ for m in list {
+ guard let id = m["id"] as? String, !id.hasSuffix(":batch") else { continue }
+ let arch = m["architecture"] as? [String: Any]
+ let out = (m["output_modalities"] ?? arch?["output_modalities"]) as? [String]
+ if let out, out != ["text"], !out.contains("text") { continue }
+ if out == nil, id.range(of: #"(embed|whisper|tts|transcribe|dall-e|image|moderation|realtime|audio|sora|search)"#,
+ options: .regularExpression) != nil { continue }
+ ids.append(id)
+ }
+ let rest = ids.filter { !recommended.contains($0) }.sorted()
+ return recommended + rest
+ }
+}
diff --git a/Sources/LiveSubs/AISettings.swift b/Sources/LiveSubs/AISettings.swift
index a265313..c927150 100644
--- a/Sources/LiveSubs/AISettings.swift
+++ b/Sources/LiveSubs/AISettings.swift
@@ -1,39 +1,42 @@
import AppKit
import SwiftUI
-/// Settings › AI 服务: the one Ling key the whole app uses, and what uses it.
+/// Settings › AI 服务: the service and its key, what works with it, and (folded away) its models.
+/// Ling is the default and the only one with everything; the others are a way in for people who
+/// cannot use Ling, with the recommended models already chosen.
struct AISettingsView: View {
@ObservedObject var model: AppModel
@ObservedObject var ling: LingClient
@ObservedObject var settings: AppSettings
@State private var draft = ""
@State private var editing = false
+ @State private var baseDraft = ""
+ @State private var textDraft = ""
+
+ private var provider: AIProvider { settings.provider }
+ private var name: String { provider.name }
var body: some View {
VStack(alignment: .leading, spacing: 14) {
keyCard
- Text("用在哪里").font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.secondary)
+ Text("现在能用的").font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.secondary)
.padding(.top, 4)
- SettingsCard {
- usageRow(L("实时纪要"), tag: ling.usable ? L("用 Ling") : L("需要 key"), on: ling.usable,
- note: ling.usable ? L("会中每 45 秒更新") : L("填好 key 后可用"))
- usageRow(L("翻译"), tag: ling.usable ? L("用 Ling") : "Google", on: ling.usable,
- note: ling.usable ? (Recognition.hasOnDeviceTranslation ? L("整句用 Ling;不行时换 Google、本机") : L("整句用 Ling;不行时换 Google"))
- : L("没有 key 时照常可用"))
- usageRow(L("语音识别"), tag: L("本机"), on: false, note: L("更快,不花钱"))
- SettingsRow(title: L("同声传译的声音"), detail: ling.usable ? L("Ming 的声音或你自己的声音") : L("没有 key 时用本机声音"),
- divider: false) {
- SoftButton(L("去选声音")) { model.settingsSection = .speak }
- }
- }
- SettingsCard {
- SettingsRow(title: L("模型"), detail: L("3.1 更准;3.0 更快、更省"), divider: false) {
- PillMenu(value: settings.aiModel, options: LingClient.models.map { ($0, $0) }) { settings.aiModel = $0 }
+ SettingsCard { usage }
+ Button { withAnimation(.easeOut(duration: 0.15)) { model.aiModelsOpen.toggle() } } label: {
+ HStack(spacing: 4) {
+ Text("自己选模型")
+ Image(systemName: "chevron.right").font(.system(size: 9, weight: .semibold))
+ .rotationEffect(.degrees(model.aiModelsOpen ? 90 : 0))
}
+ .font(.system(size: 13)).foregroundStyle(Palette.secondary).contentShape(Rectangle())
}
- Text("一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。")
- .font(.system(size: 12)).foregroundStyle(Palette.tertiary)
+ .buttonStyle(.plain)
+ if model.aiModelsOpen { SettingsCard { models } }
+ Text(footnote).font(.system(size: 12)).foregroundStyle(Palette.tertiary)
+ .fixedSize(horizontal: false, vertical: true)
}
+ .onAppear { syncDrafts() }
+ .onChange(of: settings.aiProvider) { _, _ in syncDrafts(); editing = false; draft = "" }
}
// MARK: Key
@@ -48,24 +51,25 @@ struct AISettingsView: View {
}
Spacer()
}
- if let key = ling.key, !editing {
+ if provider.id == .custom { customFields }
+ if let key = ling.key, !key.isEmpty, !editing {
HStack(spacing: 8) {
Text(AIKey.masked(key)).font(.system(size: 13, design: .monospaced)).foregroundStyle(Palette.ink)
.padding(.horizontal, 12).frame(maxWidth: .infinity, minHeight: 36, alignment: .leading)
.background(RoundedRectangle(cornerRadius: 10).fill(Color.white))
.overlay(RoundedRectangle(cornerRadius: 10).stroke(Palette.line, lineWidth: 1))
SoftButton(L("更换")) { draft = ""; editing = true }
- if case .invalid = ling.keyState {} else if case .unreachable = ling.keyState {
+ if case .unreachable = ling.keyState {
SoftButton(L("重试")) { Task { await ling.check() } }
}
}
} else {
- if ling.key == nil {
- Text("在 Ling 开放平台点“创建令牌”,复制以 sk- 开头的那串。")
+ if ling.key == nil, provider.id != .custom {
+ Text(L("在 \(name) 创建 key,复制后粘贴到这里。"))
.font(.system(size: 12)).foregroundStyle(Palette.secondary)
}
HStack(spacing: 8) {
- SecureField("sk-…", text: $draft)
+ SecureField(keyPlaceholder, text: $draft)
.textFieldStyle(.plain).font(.system(size: 13, design: .monospaced))
.padding(.horizontal, 12).frame(height: 36)
.background(RoundedRectangle(cornerRadius: 10).fill(Color.white))
@@ -74,32 +78,82 @@ struct AISettingsView: View {
SoftButton(L("保存并检查"), dark: true, action: save)
if editing { SoftButton(L("取消")) { editing = false } }
}
- Button("打开 Ling 开放平台 ↗") {
- if let url = URL(string: "https://chat.ant-ling.com/platform/api") { NSWorkspace.shared.open(url) }
+ if let site = provider.site, ling.key == nil {
+ Button(L("打开 \(name) ↗")) { NSWorkspace.shared.open(site) }
+ .buttonStyle(.plain).font(.system(size: 12)).foregroundStyle(Palette.secondary)
}
- .buttonStyle(.plain).font(.system(size: 12)).foregroundStyle(Palette.secondary)
}
HStack(spacing: 6) {
Image(systemName: "lock").font(.system(size: 11)).foregroundStyle(Palette.tertiary)
- Text("只存在这台 Mac 上(只有你的账户能读),只发给 Ling(ant-ling.com)")
- .font(.system(size: 11)).foregroundStyle(Palette.tertiary)
+ Text(lockLine).font(.system(size: 11)).foregroundStyle(Palette.tertiary).fixedSize(horizontal: false, vertical: true)
Spacer()
- if ling.key != nil && !editing {
+ if let key = ling.key, !key.isEmpty, !editing {
Button("移除") { ling.removeKey() }
.buttonStyle(.plain).font(.system(size: 11)).foregroundStyle(Palette.secondary)
}
}
}
.padding(16)
- .background(RoundedRectangle(cornerRadius: 14).fill(Color(red: 0.961, green: 0.965, blue: 0.973)))
+ .background(RoundedRectangle(cornerRadius: 14).fill(Palette.raised))
}
+ /// A custom service needs its address and a model before a key can be checked.
+ private var customFields: some View {
+ VStack(alignment: .leading, spacing: 8) {
+ field(L("地址"), "https://api.example.com/v1", $baseDraft)
+ field(L("模型"), L("例如 qwen3:14b"), $textDraft)
+ if !baseDraft.isEmpty, AIProvider.customBase(baseDraft) == nil {
+ Text("地址需用 https,仅 localhost 可用 http。").font(.system(size: 11)).foregroundStyle(Palette.error)
+ }
+ }
+ }
+
+ private func field(_ label: String, _ placeholder: String, _ text: Binding<String>) -> some View {
+ HStack(spacing: 8) {
+ Text(label).font(.system(size: 12)).foregroundStyle(Palette.secondary).frame(minWidth: 34, alignment: .leading).fixedSize()
+ TextField(placeholder, text: text)
+ .textFieldStyle(.plain).font(.system(size: 13, design: .monospaced))
+ .padding(.horizontal, 12).frame(height: 32)
+ .background(RoundedRectangle(cornerRadius: 9).fill(Color.white))
+ .overlay(RoundedRectangle(cornerRadius: 9).stroke(Palette.line, lineWidth: 1))
+ .onSubmit(save)
+ }
+ }
+
+ private var keyPlaceholder: String {
+ switch provider.id {
+ case .openrouter: "sk-or-…"
+ case .custom: AIProvider.isLocal(baseDraft) ? L("本机服务可不填") : "sk-…"
+ default: "sk-…"
+ }
+ }
+
+ private var lockLine: String {
+ let host = provider.id == .custom ? (settings.aiConfig.base?.host ?? L("你填的地址")) : (provider.base?.host ?? "")
+ return provider.id == .custom ? L("只存在这台 Mac 上(只有你的账户能读),只发给 \(host)")
+ : L("只存在这台 Mac 上(只有你的账户能读),只发给 \(name)(\(host))")
+ }
+
+ /// Saves what was typed (a custom service's address and model too), then checks.
private func save() {
+ if provider.id == .custom {
+ settings.aiCustomBase = baseDraft.trimmingCharacters(in: .whitespaces)
+ settings.aiModels["custom"] = textDraft.trimmingCharacters(in: .whitespaces)
+ model.applyAIService()
+ }
let k = draft.trimmingCharacters(in: .whitespacesAndNewlines)
- guard !k.isEmpty else { return }
draft = ""
editing = false
- Task { await ling.setKey(k) }
+ if k.isEmpty {
+ if ling.hasKey { Task { await ling.check() } }
+ } else {
+ Task { await ling.setKey(k) }
+ }
+ }
+
+ private func syncDrafts() {
+ baseDraft = settings.aiCustomBase
+ textDraft = settings.aiModels["custom"] ?? ""
}
private var statusColor: Color {
@@ -113,7 +167,7 @@ struct AISettingsView: View {
private var statusTitle: String {
switch ling.keyState {
- case .none: L("还没填 API key")
+ case .none: provider.id == .custom ? L("还没填好") : L("还没填 API key")
case .unchecked, .checking: L("正在检查…")
case .ok: L("已连接")
case .invalid: L("这个 key 用不了")
@@ -123,20 +177,221 @@ struct AISettingsView: View {
private var statusDetail: String? {
switch ling.keyState {
- case .ok(let s): L("\(settings.aiModel) · 响应约 \(String(format: "%.1f", s)) 秒")
- case .invalid: L("Ling 提示此令牌无效,请检查是否复制完整,或重新创建一个")
+ case .ok(let s): L("\(settings.textModel) · 响应约 \(String(format: "%.1f", s)) 秒")
+ case .invalid: L("\(name) 提示 key 无效,请检查是否复制完整,或重新创建一个")
case .unreachable(let why): why
case .none: L("不填 key 时,字幕和翻译仍可正常使用")
default: nil
}
}
- private func usageRow(_ title: String, tag: String, on: Bool, note: String, divider: Bool = true) -> some View {
+ // MARK: What works
+
+ @ViewBuilder private var usage: some View {
+ let on = ling.usable
+ let uses = L("用 \(name)")
+ usageRow(L("实时纪要"), tag: on ? uses : L("需要 key"), style: on ? .ok : .off,
+ note: on ? L("会中每 45 秒更新") : L("填好 key 后可用"))
+ usageRow(L("翻译"), tag: on ? uses : "Google", style: on ? .ok : .off,
+ note: on ? (Recognition.hasOnDeviceTranslation ? L("整句用它;不行时换 Google、本机") : L("整句用它;不行时换 Google"))
+ : L("没有 key 时照常可用"))
+ usageRow(L("同传声音"), tag: ling.speaks ? uses : L("本机"), style: ling.speaks ? .ok : .off, note: voiceNote)
+ if provider.clones {
+ usageRow(L("你自己的声音"), tag: on ? uses : L("需要 key"), style: on ? .ok : .off, note: L("录一段,让对方听到你的音色"))
+ } else {
+ usageRow(L("你自己的声音"), tag: L("只有 Ling"), style: .ling, note: L("换用 Ling 才有"))
+ }
+ usageRow(L("语音识别"), tag: L("本机"), style: .off, note: L("更快,不花钱"), divider: false)
+ }
+
+ private var voiceNote: String {
+ if ling.speaks { return provider.id == .ling ? L("Ming 的声音") : (settings.aiConfig.voiceModel ?? "") }
+ if !ling.usable { return L("没有 key 时用本机声音") }
+ return provider.id == .custom ? L("没填声音模型,用本机声音") : L("\(name) 暂不能出声音,用本机声音")
+ }
+
+ private enum TagStyle { case ok, off, ling }
+
+ private func usageRow(_ title: String, tag: String, style: TagStyle, note: String, divider: Bool = true) -> some View {
SettingsRow(title: title, detail: note, divider: divider) {
Text(tag).font(.system(size: 11, weight: .semibold))
- .foregroundStyle(on ? Palette.ok : Palette.secondary)
+ .foregroundStyle(style == .ok ? Palette.ok : style == .ling ? Palette.accentInk : Palette.secondary)
.padding(.horizontal, 8).padding(.vertical, 3)
- .background(RoundedRectangle(cornerRadius: 6).fill(on ? Palette.okPale : Palette.fill))
+ .background(RoundedRectangle(cornerRadius: 6).fill(style == .ok ? Palette.okPale : style == .ling ? Palette.accentPale : Palette.fill))
+ .lineLimit(1).fixedSize()
+ }
+ }
+
+ // MARK: Models
+
+ @ViewBuilder private var models: some View {
+ switch provider.id {
+ case .ling:
+ SettingsRow(title: L("模型"), detail: L("3.1 更准;3.0 更快、更省"), divider: false) {
+ PillMenu(value: settings.aiModel, options: LingClient.models.map { ($0, $0) }) {
+ settings.aiModel = $0
+ model.applyAIService()
+ }
+ }
+ case .custom:
+ customVoiceFields
+ default:
+ SettingsRow(title: L("文字模型"), detail: L("纪要和整句翻译"), divider: provider.hasVoices) {
+ ModelMenu(value: settings.textModel, recommended: provider.textModels, catalog: ling.catalog) {
+ settings.aiModels[provider.id.rawValue] = $0
+ model.applyAIService()
+ }
+ }
+ if provider.hasVoices {
+ SettingsRow(title: L("声音模型"), detail: L("同传念给对方"), divider: false) {
+ ModelMenu(value: settings.aiConfig.voiceModel ?? "", recommended: provider.voiceModels, catalog: []) {
+ settings.aiVoiceModels[provider.id.rawValue] = $0
+ model.applyAIService()
+ }
+ }
+ }
}
}
+
+ /// A custom service speaks only when given a speech model (`/audio/speech`), maybe at another address.
+ private var customVoiceFields: some View {
+ VStack(alignment: .leading, spacing: 8) {
+ Text("声音(可选)").font(.system(size: 13)).foregroundStyle(Palette.ink)
+ Text("需支持 /audio/speech;不填则用本机声音。").font(.system(size: 11)).foregroundStyle(Palette.tertiary)
+ CommitField(label: L("模型"), placeholder: L("例如 kokoro"), value: settings.aiVoiceModels["custom"] ?? "") {
+ settings.aiVoiceModels["custom"] = $0
+ model.applyAIService()
+ }
+ CommitField(label: L("声音"), placeholder: L("例如 af_heart"), value: settings.aiCustomVoice) {
+ settings.aiCustomVoice = $0
+ model.applyAIService()
+ }
+ CommitField(label: L("地址"), placeholder: L("跟上面一样"), value: settings.aiCustomVoiceBase) {
+ settings.aiCustomVoiceBase = $0
+ model.applyAIService()
+ }
+ }
+ .padding(.horizontal, 16).padding(.vertical, 12)
+ }
+
+ private var footnote: String {
+ switch provider.id {
+ case .ling: L("一小时会议约 ¥0.15–1(目前优惠价)。发出去的只有文字(用你自己的声音时还有那段录音),语音识别留在本机。")
+ default: L("按所选模型计费。发出去的只有文字,语音识别留在本机。")
+ }
+ }
+}
+
+/// The service, in the page header: Ling first, the others for when Ling cannot be used.
+struct AIServiceMenu: View {
+ @ObservedObject var model: AppModel
+ @ObservedObject var settings: AppSettings
+
+ static func title(_ p: AIProvider) -> String { p.id == .custom ? L("其他(兼容 OpenAI)") : p.name }
+
+ var body: some View {
+ PillMenu(value: Self.title(settings.provider),
+ options: AIProvider.all.map { ($0.id.rawValue, $0.id == .ling ? "Ling" + L("(推荐)") : Self.title($0)) }) {
+ guard $0 != settings.aiProvider else { return }
+ settings.aiProvider = $0
+ model.applyAIService()
+ }
+ }
+}
+
+/// A model menu: the recommended ones (with why) first, then everything the service lists, by
+/// maker, then a name typed by hand.
+struct ModelMenu: View {
+ let value: String
+ let recommended: [AIProvider.Model]
+ let catalog: [String]
+ let onPick: (String) -> Void
+ @State private var typing = false
+ @State private var typed = ""
+
+ var body: some View {
+ if typing {
+ HStack(spacing: 6) {
+ TextField(L("模型名"), text: $typed)
+ .textFieldStyle(.plain).font(.system(size: 12, design: .monospaced))
+ .padding(.horizontal, 8).frame(width: 220, height: 28)
+ .background(RoundedRectangle(cornerRadius: 7).fill(Color.white))
+ .overlay(RoundedRectangle(cornerRadius: 7).stroke(Palette.line, lineWidth: 1))
+ .onSubmit(commit)
+ SoftButton(L("好"), dark: true, action: commit)
+ SoftButton(L("取消")) { typing = false }
+ }
+ } else {
+ Menu {
+ Section(L("推荐")) {
+ ForEach(recommended, id: \.id) { m in
+ Button(m.note.isEmpty ? m.id : "\(m.id) · \(m.note)") { onPick(m.id) }
+ }
+ }
+ let rest = catalog.filter { id in !recommended.contains { $0.id == id } }
+ if !rest.isEmpty {
+ Section(L("全部 \(rest.count) 个")) {
+ ForEach(groups(rest), id: \.0) { maker, ids in
+ Menu(maker) { ForEach(ids, id: \.self) { id in Button(id) { onPick(id) } } }
+ }
+ }
+ }
+ Divider()
+ Button(L("填其他模型名…")) { typed = value; typing = true }
+ } label: {
+ HStack(spacing: 6) {
+ Text(value.isEmpty ? L("选一个") : value).font(.system(size: 13)).foregroundStyle(Palette.ink).lineLimit(1)
+ Image(systemName: "chevron.up.chevron.down").font(.system(size: 9, weight: .semibold))
+ .foregroundStyle(Palette.secondary)
+ }
+ .padding(.horizontal, 10).frame(height: 28)
+ .background(RoundedRectangle(cornerRadius: 7).fill(Palette.ground))
+ .contentShape(Rectangle())
+ }
+ .menuStyle(.button).buttonStyle(.plain).menuIndicator(.hidden).fixedSize()
+ }
+ }
+
+ private func commit() {
+ let t = typed.trimmingCharacters(in: .whitespaces)
+ typing = false
+ if !t.isEmpty { onPick(t) }
+ }
+
+ /// "openai/gpt-5-mini" → under "openai"; names without a maker go under "其他".
+ private func groups(_ ids: [String]) -> [(String, [String])] {
+ let other = L("其他")
+ let by = Dictionary(grouping: ids) { $0.contains("/") ? String($0.prefix { $0 != "/" }) : other }
+ return by.keys.sorted().map { ($0, by[$0]!.sorted()) }
+ }
+}
+
+/// A labelled text field that saves on return or when it loses focus.
+private struct CommitField: View {
+ let label: String
+ let placeholder: String
+ let value: String
+ let onCommit: (String) -> Void
+ @State private var text = ""
+ @FocusState private var focused: Bool
+
+ var body: some View {
+ HStack(spacing: 8) {
+ Text(label).font(.system(size: 12)).foregroundStyle(Palette.secondary).frame(minWidth: 34, alignment: .leading).fixedSize()
+ TextField(placeholder, text: $text)
+ .textFieldStyle(.plain).font(.system(size: 13, design: .monospaced))
+ .padding(.horizontal, 12).frame(height: 30)
+ .background(RoundedRectangle(cornerRadius: 9).fill(Color.white))
+ .overlay(RoundedRectangle(cornerRadius: 9).stroke(Palette.line, lineWidth: 1))
+ .focused($focused)
+ .onSubmit { commit() }
+ .onChange(of: focused) { _, now in if !now { commit() } }
+ }
+ .onAppear { text = value }
+ }
+
+ private func commit() {
+ let t = text.trimmingCharacters(in: .whitespaces)
+ if t != value { onCommit(t) }
+ }
}
diff --git a/Sources/LiveSubs/AppModel.swift b/Sources/LiveSubs/AppModel.swift
index 6fa3a8c..8c15b95 100644
--- a/Sources/LiveSubs/AppModel.swift
+++ b/Sources/LiveSubs/AppModel.swift
@@ -35,6 +35,8 @@ final class AppModel: ObservableObject {
@Published var micGuide: MicUser?
/// Settings › 同声传译: the voice list under "对方听到" is open.
@Published var voicePickerOpen = false
+ /// Settings › AI 服务's 自己选模型 is unfolded.
+ @Published var aiModelsOpen = false
@Published var running = false
/// The meeting is about to end by itself (a hang-up or a long silence) unless someone keeps it going.
@@ -182,7 +184,7 @@ final class AppModel: ObservableObject {
}
ling.onCall = { [weak self] in self?.diagnostics.record($0) }
- ling.model = { [weak self] in self?.settings.aiModel ?? "Ling-3.1-flash" }
+ ling.config = { [weak self] in self?.settings.aiConfig ?? AIConfig(provider: .ling, base: AIProvider.ling.base, textModel: "Ling-3.1-flash") }
listen.translator = translator
translator.glossary = { [weak self] in self?.notes.glossary ?? [] }
importer.onFinished = { [weak self] id in self?.importFinished(id) }
@@ -190,7 +192,7 @@ final class AppModel: ObservableObject {
TranslationService.englishName(self?.notesLanguageCode(id) ?? "zh-CN")
}
listen.translationOff = { [weak self] in self?.subtitles == "original" }
- if ling.hasKey { Task { await ling.check() } }
+ applyAIService()
installer.speakThrough = { [weak self] text, lang, device in
await self?.speak.speak(text, language: lang, device: device)
@@ -849,13 +851,32 @@ final class AppModel: ObservableObject {
}
}
- /// The chosen voice for a language, or its default (Ming's first with a key, else the Mac's).
+ /// The chosen voice for a language, or its default (the service's first with a key, else the
+ /// Mac's). A choice the service in use cannot speak (Ming after switching to OpenRouter, the
+ /// user's own voice without Ling) falls back to the default, and comes back with that service.
func voiceID(for language: String) -> String? {
- if let id = settings.speakVoices[VoiceCatalog.key(for: language)] {
- if id == "clone" && !VoiceReference.exists { return VoiceCatalog.defaultID(for: language, hasKey: ling.usable) }
- return id
+ let fallback = VoiceCatalog.defaultID(for: language, hasKey: ling.speaks)
+ guard let id = settings.speakVoices[VoiceCatalog.key(for: language)] else { return fallback }
+ if id.hasPrefix("system:") { return id }
+ if id == "clone" { return VoiceReference.exists && ling.clones ? id : fallback }
+ return VoiceCatalog.remote(for: language).contains { $0.id == id } ? id : fallback
+ }
+
+ /// Settings changed the AI service, its address or a model: voices follow, the key is checked again.
+ func applyAIService() {
+ let c = settings.aiConfig
+ switch c.provider.id {
+ case .ling: VoiceCatalog.service = .ming
+ default:
+ let label = c.provider.id == .custom ? (c.voiceModel ?? "") : c.voiceModel.map { $0.contains("gemini") ? "Gemini" : c.provider.name } ?? ""
+ VoiceCatalog.service = c.hasVoices ? .cloud(label: label, voices: c.voices) : .none
+ }
+ speak.streamName = { [weak self] in
+ guard let id = self?.settings.provider.id, id != .ling else { return "ming" }
+ return id.rawValue
}
- return VoiceCatalog.defaultID(for: language, hasKey: ling.usable)
+ ling.reconfigure()
+ applyVoice()
}
func setVoice(_ id: String, for language: String) {
@@ -866,9 +887,17 @@ final class AppModel: ObservableObject {
func voiceRoute(id: String?, language: String) -> SpeakEngine.VoiceRoute {
guard let id else { return .system(nil) }
if id.hasPrefix("system:") { return .system(String(id.dropFirst("system:".count))) }
- guard ling.usable else { return .system(nil) }
+ guard ling.speaks else { return .system(nil) }
+ if id.hasPrefix("cloud:") {
+ let voice = String(id.dropFirst("cloud:".count))
+ return .stream { [weak self] text in
+ self?.ling.speech(text, voice: voice)
+ ?? AsyncThrowingStream { $0.finish(throwing: LingClient.Failure.noKey) }
+ }
+ }
let lang = VoiceCatalog.mingLanguage(for: language)
if id == "clone" {
+ guard ling.clones else { return .system(nil) }
guard let ref = VoiceReference.reference() else { return .system(nil) }
return .stream { [weak self] text in
self?.ling.speech(text, voice: nil, reference: ref, language: lang)
@@ -1311,7 +1340,7 @@ final class AppModel: ObservableObject {
setDiagnostics(arg != "off")
debugLog("diagnostics \(settings.diagnostics ? "on" : "off")")
case "diagReport":
- debugLog("diag report:\n" + diagnostics.report(version: "", model: settings.aiModel))
+ debugLog("diag report:\n" + diagnostics.report(version: "", model: settings.textModel))
case "micTest": installer.runTest()
case "micNext": installer.next()
case "sysMic":
@@ -1492,7 +1521,20 @@ final class AppModel: ObservableObject {
// aiHide:<on|off>: the key file stays; the app behaves as if there were none (for screenshots).
ling.hideKey = arg != "off"
Task { await ling.check() }
- case "aiState": debugLog("ai state=\(ling.keyState) hasKey=\(ling.hasKey) model=\(settings.aiModel)")
+ case "aiState":
+ let c = settings.aiConfig
+ debugLog("ai state=\(ling.keyState) provider=\(c.provider.id.rawValue) hasKey=\(ling.hasKey) model=\(c.textModel) "
+ + "voice=\(c.voiceModel ?? "-") speaks=\(ling.speaks) clones=\(ling.clones) catalog=\(ling.catalog.count)")
+ // AI service: aiProvider:<ling|openrouter|zenmux|openai|custom>, aiTextModel:<id>, aiVoiceModel:<id|"">,
+ // aiCustomBase:<url>, aiCustomVoiceBase:<url|"">, aiCustomVoice:<name>.
+ case "aiProvider": settings.aiProvider = AIProvider.named(arg).id.rawValue; applyAIService()
+ case "aiTextModel":
+ if settings.provider.id == .ling { settings.aiModel = arg } else { settings.aiModels[settings.aiProvider] = arg }
+ applyAIService()
+ case "aiVoiceModel": settings.aiVoiceModels[settings.aiProvider] = arg; applyAIService()
+ case "aiCustomBase": settings.aiCustomBase = arg; applyAIService()
+ case "aiCustomVoiceBase": settings.aiCustomVoiceBase = arg; applyAIService()
+ case "aiCustomVoice": settings.aiCustomVoice = arg; applyAIService()
case "subtitles": setSubtitles(arg)
case "meetingSubtitles": setSubtitles(arg, meetingOnly: true)
case "notesLang": setNotesLanguage(arg)
@@ -1521,6 +1563,7 @@ final class AppModel: ObservableObject {
speak.resetOutput()
debugLog("speak output=\(speak.outputDevice()?.name ?? "-")")
case "voicePicker": voicePickerOpen = arg != "off"
+ case "aiModels": aiModelsOpen = arg != "off"
case "speakTestBegin": speakTester.beginTalking()
case "speakTestEnd": speakTester.endTalking()
case "speakTestClose": speakTester.cancel(); speakTestShown = false
diff --git a/Sources/LiveSubs/Ling.swift b/Sources/LiveSubs/Ling.swift
index b10235d..ad1aed0 100644
--- a/Sources/LiveSubs/Ling.swift
+++ b/Sources/LiveSubs/Ling.swift
@@ -3,54 +3,58 @@ import Security
// MARK: - API key (local file)
-/// The user's Ling API key, in a file only this user can read (0600, folder 0700) under
-/// Application Support, left out of backups. Never written to UserDefaults, logs or exports.
+/// The user's AI keys, one file per service (`ling-api-key`, `ai-key-<service>`) only this user
+/// can read (0600, folder 0700) under Application Support, left out of backups. Never written to
+/// UserDefaults, logs or exports.
///
/// Not the Keychain for now: the app is signed ad hoc, so the Keychain only trusts one exact build
/// (its cdhash) and asks for the login password after every rebuild or update. Back to the Keychain
/// once builds are signed with a Developer ID (a stable team id). Keys saved there by earlier
/// builds are moved over once.
enum AIKey {
- private static var cached: String??
+ private static var cached: [String: String?] = [:]
/// Tests only: keep the key in this folder instead, and leave the Keychain alone, so a test
/// run never touches the user's real key.
- static var folderOverride: URL? { didSet { cached = nil } }
+ static var folderOverride: URL? { didSet { cached = [:] } }
private static var folder: URL {
folderOverride ?? FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask)[0]
.appendingPathComponent(DevBuild.supportFolder)
}
- private static var file: URL { folder.appendingPathComponent("ling-api-key") }
+ private static func file(_ service: String) -> URL {
+ folder.appendingPathComponent(service == "ling" ? "ling-api-key" : "ai-key-\(service)")
+ }
- static func read() -> String? {
- if let cached { return cached }
- var value = (try? String(contentsOf: file, encoding: .utf8))?.trimmingCharacters(in: .whitespacesAndNewlines)
+ static func read(_ service: String = "ling") -> String? {
+ if let hit = cached[service] { return hit }
+ var value = (try? String(contentsOf: file(service), encoding: .utf8))?.trimmingCharacters(in: .whitespacesAndNewlines)
if value?.isEmpty ?? true { value = nil }
- if value == nil, folderOverride == nil, let old = LegacyKeychain.take() {
+ if value == nil, service == "ling", folderOverride == nil, let old = LegacyKeychain.take() {
// One last Keychain prompt, then the key lives in the file.
value = old
- write(old)
+ write(old, service)
}
- cached = .some(value)
+ cached[service] = .some(value)
return value
}
@discardableResult
- static func save(_ key: String) -> Bool {
- let ok = write(key)
- cached = .some(ok ? key : nil)
+ static func save(_ key: String, _ service: String = "ling") -> Bool {
+ let ok = write(key, service)
+ cached[service] = .some(ok ? key : nil)
return ok
}
- static func remove() {
- try? FileManager.default.removeItem(at: file)
- if folderOverride == nil { LegacyKeychain.delete() }
- cached = .some(nil)
+ static func remove(_ service: String = "ling") {
+ try? FileManager.default.removeItem(at: file(service))
+ if service == "ling", folderOverride == nil { LegacyKeychain.delete() }
+ cached[service] = .some(nil)
}
@discardableResult
- private static func write(_ key: String) -> Bool {
+ private static func write(_ key: String, _ service: String) -> Bool {
+ let file = file(service)
let fm = FileManager.default
do {
try fm.createDirectory(at: folder, withIntermediateDirectories: true)
@@ -112,11 +116,13 @@ enum AIKey {
// MARK: - Ling client
-/// Ling (ant-ling.com), OpenAI-compatible. One shared instance for the whole app: the account
-/// allows about 2 requests per second across every model, so request *starts* go through one
-/// gate (≥ 0.6 s apart, overlapping is fine) in priority order: speak-back, translation, notes.
+/// The one AI client for the whole app: Ling (ant-ling.com) or another OpenAI-compatible service
+/// (`AIProvider`), whichever settings name. Request *starts* go through one gate in priority order
+/// (speak-back, translation, notes), spaced for the service: Ling's account allows about 2
+/// requests per second across every model.
///
-/// Two quirks found in testing shape every call:
+/// Two Ling quirks found in testing shape every call (`AIConfig.shape` turns thinking off for the
+/// others too, each its own way):
/// - `thinking` is on by default: always disable it (otherwise +2.6 s and billed reasoning).
/// - When the user message reads like a factual question, the gateway answers it with a search
/// essay instead of following the prompt. So the content always goes in the system message and
@@ -141,13 +147,17 @@ final class LingClient: ObservableObject {
case noKey, invalidKey, rateLimited, hijacked, timeout, http(Int), network, parse
}
- static let models = ["Ling-3.1-flash", "Ling-3.0-flash"]
- private static let base = URL(string: "https://api.ant-ling.com/v1/")!
+ static let models = AIProvider.ling.textModels.map(\.id)
private static let hijackPrefixes = ["根据现有检索证据", "暂未找到足够可靠的信息", "根据检索"]
@Published private(set) var keyState: KeyState
@Published private(set) var rateLimitedAt: Date?
- var model: () -> String = { "Ling-3.1-flash" }
+ /// The service's text models from its `/models`, recommended first (empty until fetched).
+ @Published private(set) var catalog: [String] = []
+ /// The service in use, its address and models. Set by the app from settings.
+ var config: () -> AIConfig = { AIConfig(provider: .ling, base: AIProvider.ling.base, textModel: "Ling-3.1-flash",
+ voiceModel: "Ming-3.0-tts-0.5B", voiceBase: AIProvider.ling.base) }
+ var provider: AIProvider { config().provider }
/// Debug control only: make every chat call fail this way.
var simulate: Failure?
@@ -159,14 +169,36 @@ final class LingClient: ObservableObject {
var session: URLSession = .shared
var hasKey: Bool { key != nil }
- var key: String? { hideKey ? nil : AIKey.read() }
- /// The key is known to work (or at least not known to be bad).
+ /// The key for the service in use. A custom service on this Mac may need none: "".
+ var key: String? {
+ if hideKey { return nil }
+ let c = config()
+ if c.provider.id == .custom {
+ guard let base = c.base else { return nil }
+ return AIKey.read(c.provider.id.rawValue) ?? (AIProvider.isLocal(base.absoluteString) ? "" : nil)
+ }
+ return AIKey.read(c.provider.id.rawValue)
+ }
+ /// The key is known to work (or at least not known to be bad): notes and translation.
var usable: Bool { hasKey && keyState != .invalid }
+ /// Voices in the room from this service (else the Mac's).
+ var speaks: Bool { usable && config().hasVoices }
+ /// The user's own voice: only Ling clones.
+ var clones: Bool { usable && provider.clones }
+ /// Speak-back heard by the service's audio model (Ming) instead of on this Mac.
+ var hearsAudio: Bool { usable && provider.hearsAudio }
init() {
keyState = AIKey.read() == nil ? .none : .unchecked
}
+ /// Settings switched service, address or model: forget the old state and check again.
+ func reconfigure() {
+ catalog = []
+ keyState = hasKey ? .unchecked : .none
+ if hasKey { Task { await check() } }
+ }
+
// MARK: Key
/// Saves the key and checks it with the cheapest possible request.
@@ -174,36 +206,69 @@ final class LingClient: ObservableObject {
let k = raw.trimmingCharacters(in: .whitespacesAndNewlines)
guard !k.isEmpty else { return }
if hideKey { debugLog("ai key: not saved while hidden (debug)"); keyState = .invalid; return }
- AIKey.save(k)
+ AIKey.save(k, provider.id.rawValue)
await check()
}
func removeKey() {
- AIKey.remove()
- keyState = .none
+ AIKey.remove(provider.id.rawValue)
+ catalog = []
+ keyState = hasKey ? .unchecked : .none
}
+ /// The cheapest request that proves the key: Ling's tiny model, OpenRouter's key info, OpenAI's
+ /// model list, else one token from the chosen model. A custom service must also return JSON
+ /// (the notes need it).
func check() async {
guard let key else { keyState = .none; return }
keyState = .checking
+ let c = config()
let started = Date()
- let body: [String: Any] = [
- "model": "Ling-3.0-tiny",
- "messages": [["role": "user", "content": "hi"]],
- "max_tokens": 1,
- "thinking": ["type": "disabled"],
- ]
+ let name = c.provider.id == .custom ? L("这个服务") : c.provider.name
do {
- _ = try await post("chat/completions", body: body, key: key, timeout: 15)
+ switch c.provider.id {
+ case .ling:
+ _ = try await post("chat/completions", body: ["model": "Ling-3.0-tiny", "messages": [["role": "user", "content": "hi"]],
+ "max_tokens": 1, "thinking": ["type": "disabled"]], key: key, timeout: 15)
+ case .openrouter:
+ _ = try await get("key", key: key)
+ case .openai:
+ _ = try await get("models", key: key)
+ case .zenmux, .custom:
+ var body: [String: Any] = ["model": c.textModel, "messages": [["role": "user", "content": "hi"]]]
+ c.shape(&body, maxTokens: 1)
+ _ = try await post("chat/completions", body: body, key: key, timeout: 20)
+ if c.provider.id == .custom {
+ var json: [String: Any] = ["model": c.textModel, "response_format": ["type": "json_object"],
+ "messages": [["role": "system", "content": "Reply with the JSON object {\"ok\": true}."],
+ ["role": "user", "content": "Reply."]]]
+ c.shape(&json, maxTokens: 20)
+ do { _ = try await post("chat/completions", body: json, key: key, timeout: 20) } catch Failure.http(let code) {
+ keyState = .unreachable(L("这个服务不支持 JSON(HTTP \(code)),纪要用不了"))
+ return
+ }
+ }
+ }
keyState = .ok(seconds: Date().timeIntervalSince(started))
} catch Failure.invalidKey {
keyState = .invalid
} catch Failure.rateLimited {
keyState = .ok(seconds: Date().timeIntervalSince(started))
+ } catch Failure.http(let code) where code == 404 || code == 400 {
+ keyState = .unreachable(c.provider.id == .custom ? L("找不到模型,或地址不对(HTTP \(code))") : L("\(name) 拒绝了请求(HTTP \(code)),请检查模型名"))
} catch {
- keyState = .unreachable(L("连不上 Ling,检查网络或代理"))
+ keyState = .unreachable(L("连不上 \(name),请检查网络或代理"))
}
- debugLog("ling: key check → \(keyState)")
+ debugLog("ai \(c.provider.id.rawValue): key check → \(keyState)")
+ if case .ok = keyState, c.provider.id != .ling { await fetchCatalog() }
+ }
+
+ /// The service's text models, for the model menu. Quietly empty when it has no `/models`.
+ func fetchCatalog() async {
+ let c = config()
+ guard let key, c.provider.id != .ling, let data = try? await getData("models", key: key) else { return }
+ catalog = AIConfig.textModels(fromCatalog: data, recommended: c.provider.textModels.map(\.id))
+ debugLog("ai \(c.provider.id.rawValue): \(catalog.count) models")
}
// MARK: Chat
@@ -211,7 +276,7 @@ final class LingClient: ObservableObject {
/// One chat completion. `content` goes in the system message, `instruction` is the fixed user
/// message. Notes retry 429s with backoff; translation and speak-back fail fast so the caller
/// can fall back to another translator. `audio` (a WAV) goes in the user message before the
- /// instruction, for Ming's audio model.
+ /// instruction, for Ming's audio model (Ling only: `hearsAudio`).
func chat(content: String, instruction: String, priority: Priority, json: Bool = false,
maxTokens: Int = 1024, timeout: TimeInterval = 30, model: String? = nil, audio: Data? = nil,
onQueued: ((Double) -> Void)? = nil) async throws -> String {
@@ -221,8 +286,9 @@ final class LingClient: ObservableObject {
if simulate == .rateLimited { rateLimitedAt = Date() }
throw simulate
}
+ let c = config()
var body: [String: Any] = [
- "model": model ?? self.model(),
+ "model": model ?? c.textModel,
"messages": [
["role": "system", "content": content],
["role": "user", "content": audio.map { wav -> Any in
@@ -230,11 +296,9 @@ final class LingClient: ObservableObject {
["type": "text", "text": instruction]]
} ?? instruction],
],
- "max_tokens": maxTokens,
- "temperature": 0.2,
- "thinking": ["type": "disabled"],
"stream": false,
]
+ c.shape(&body, maxTokens: maxTokens)
if json { body["response_format"] = ["type": "json_object"] }
let attempts = priority == .notes ? 4 : 1
var delay = 1.0
@@ -251,7 +315,7 @@ final class LingClient: ObservableObject {
let text = message["content"] as? String else { throw Failure.parse }
let finish = choice["finish_reason"] as? String
let trimmed = text.trimmingCharacters(in: .whitespacesAndNewlines)
- if finish == nil || Self.hijackPrefixes.contains(where: { trimmed.hasPrefix($0) }) {
+ if (finish == nil && c.provider.id == .ling) || Self.hijackPrefixes.contains(where: { trimmed.hasPrefix($0) }) {
debugLog("ling: \(priority) search-style reply dropped (finish=\(finish ?? "nil"))")
throw Failure.hijacked
}
@@ -293,37 +357,50 @@ final class LingClient: ObservableObject {
}
}
- // MARK: Speech (Ming TTS)
+ // MARK: Speech
- /// Streams Ming's voice for `text` as raw 24 kHz mono 16-bit PCM chunks: a built-in `voice`, or
- /// a voice cloned from `reference` (a WAV data URI and what it says). `language` is Ming's
- /// `language_id`, needed for Japanese, Korean, German, French and Spanish.
+ /// Streams the voice for `text` as raw 24 kHz mono 16-bit PCM chunks. Ling (Ming): a built-in
+ /// `voice`, or a voice cloned from `reference` (a WAV data URI and what it says); `language` is
+ /// Ming's `language_id`, needed for Japanese, Korean, German, French and Spanish. Others: the
+ /// configured speech model and `voice`.
+ ///
+ /// Replies come three ways and all are read: SSE with base64 chunks (Ling, ZenMux), raw PCM
+ /// bytes (OpenRouter), or one JSON `{"audio": <WAV>}`. Gemini TTS and Kokoro speak 24 kHz too.
func speech(_ text: String, voice: String? = "UK_Charlotte", reference: (audio: String, text: String)? = nil,
language: String? = nil) -> AsyncThrowingStream<Data, Error> {
AsyncThrowingStream { cont in
let task = Task { @MainActor [weak self] in
guard let self, let key = self.key else { cont.finish(throwing: Failure.noKey); return }
+ let c = self.config()
+ guard let base = c.voiceBase, let voiceModel = c.voiceModel else { cont.finish(throwing: Failure.noKey); return }
await self.acquire(.speak)
- var req = URLRequest(url: Self.base.appendingPathComponent("audio/speech"))
+ var req = URLRequest(url: base.appendingPathComponent("audio/speech"))
req.httpMethod = "POST"
req.timeoutInterval = 20
- req.setValue("Bearer \(key)", forHTTPHeaderField: "Authorization")
+ if !key.isEmpty { req.setValue("Bearer \(key)", forHTTPHeaderField: "Authorization") }
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
- var body: [String: Any] = [
- "model": "Ming-3.0-tts-0.5B", "input": text,
- "response_format": "pcm", "sample_rate": 24000, "stream": true, "stream_format": "sse",
- ]
- if let reference {
- body["references"] = [["audio": reference.audio, "text": reference.text]]
- req.timeoutInterval = 30
- } else if let voice {
- body["voice"] = voice
+ var body: [String: Any] = ["model": voiceModel, "input": text, "response_format": "pcm"]
+ if c.provider.id == .ling {
+ body["sample_rate"] = 24000
+ body["stream"] = true
+ body["stream_format"] = "sse"
+ if let reference {
+ body["references"] = [["audio": reference.audio, "text": reference.text]]
+ req.timeoutInterval = 30
+ } else if let voice {
+ body["voice"] = voice
+ }
+ if let language { body["language_id"] = language }
+ } else {
+ // OpenRouter documents no `stream` (it streams the bytes anyway); ZenMux needs it.
+ if c.provider.id != .openrouter { body["stream"] = true }
+ body["voice"] = voice ?? c.voices.first?.id ?? "Kore"
}
- if let language { body["language_id"] = language }
req.httpBody = try? JSONSerialization.data(withJSONObject: body)
do {
let (bytes, response) = try await self.session.bytes(for: req)
- switch (response as? HTTPURLResponse)?.statusCode ?? 0 {
+ let http = response as? HTTPURLResponse
+ switch http?.statusCode ?? 0 {
case 200: break
case 401, 403:
self.keyState = .invalid
@@ -331,12 +408,30 @@ final class LingClient: ObservableObject {
case 429: throw Failure.rateLimited
case let code: throw Failure.http(code)
}
- for try await line in bytes.lines {
- guard line.hasPrefix("data:"),
- let obj = try? JSONSerialization.jsonObject(with: Data(line.dropFirst(5).utf8)) as? [String: Any]
- else { continue }
- if obj["type"] as? String == "speech.audio.done" { break }
- if let b64 = obj["audio"] as? String, let pcm = Data(base64Encoded: b64) { cont.yield(pcm) }
+ let type = http?.value(forHTTPHeaderField: "Content-Type") ?? ""
+ if type.contains("event-stream") {
+ for try await line in bytes.lines {
+ guard line.hasPrefix("data:"),
+ let obj = try? JSONSerialization.jsonObject(with: Data(line.dropFirst(5).utf8)) as? [String: Any]
+ else { continue }
+ if obj["type"] as? String == "speech.audio.done" { break }
+ if let b64 = obj["audio"] as? String, let pcm = Data(base64Encoded: b64) { cont.yield(pcm) }
+ }
+ } else if type.contains("json") {
+ var data = Data()
+ for try await b in bytes { data.append(b) }
+ guard let obj = try JSONSerialization.jsonObject(with: data) as? [String: Any],
+ let b64 = obj["audio"] as? String, let wav = Data(base64Encoded: b64) else { throw Failure.parse }
+ cont.yield(Self.pcm(fromWAV: wav))
+ } else {
+ // Raw PCM: hand it on in 0.1 s pieces so playback starts early.
+ var chunk = Data()
+ chunk.reserveCapacity(4800)
+ for try await b in bytes {
+ chunk.append(b)
+ if chunk.count >= 4800 { cont.yield(chunk); chunk.removeAll(keepingCapacity: true) }
+ }
+ if !chunk.isEmpty { cont.yield(chunk) }
}
cont.finish()
} catch {
@@ -347,15 +442,48 @@ final class LingClient: ObservableObject {
}
}
+ /// The samples of a WAV (its `data` chunk); the bytes as they are when there is no header.
+ nonisolated static func pcm(fromWAV wav: Data) -> Data {
+ guard wav.count > 12, wav.prefix(4) == Data("RIFF".utf8) else { return wav }
+ var i = 12
+ while i + 8 <= wav.count {
+ let id = wav.subdata(in: i..<i + 4)
+ let size = wav.subdata(in: i + 4..<i + 8).withUnsafeBytes { Int($0.loadUnaligned(as: UInt32.self).littleEndian) }
+ if id == Data("data".utf8) { return wav.subdata(in: i + 8..<min(wav.count, i + 8 + size)) }
+ i += 8 + size + (size & 1)
+ }
+ return wav
+ }
+
// MARK: Transport
private func post(_ path: String, body: [String: Any], key: String, timeout: TimeInterval) async throws -> [String: Any] {
- var req = URLRequest(url: Self.base.appendingPathComponent(path))
+ guard let base = config().base else { throw Failure.noKey }
+ var req = URLRequest(url: base.appendingPathComponent(path))
req.httpMethod = "POST"
req.timeoutInterval = timeout
- req.setValue("Bearer \(key)", forHTTPHeaderField: "Authorization")
- req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = try JSONSerialization.data(withJSONObject: body)
+ let data = try await send(req, key: key)
+ guard let root = try JSONSerialization.jsonObject(with: data) as? [String: Any] else { throw Failure.parse }
+ return root
+ }
+
+ private func get(_ path: String, key: String) async throws -> [String: Any] {
+ let data = try await getData(path, key: key)
+ return (try? JSONSerialization.jsonObject(with: data) as? [String: Any]) ?? [:]
+ }
+
+ private func getData(_ path: String, key: String) async throws -> Data {
+ guard let base = config().base else { throw Failure.noKey }
+ var req = URLRequest(url: base.appendingPathComponent(path))
+ req.timeoutInterval = 15
+ return try await send(req, key: key)
+ }
+
+ private func send(_ request: URLRequest, key: String) async throws -> Data {
+ var req = request
+ if !key.isEmpty { req.setValue("Bearer \(key)", forHTTPHeaderField: "Authorization") }
+ req.setValue("application/json", forHTTPHeaderField: "Content-Type")
let data: Data
let response: URLResponse
do {
@@ -368,7 +496,7 @@ final class LingClient: ObservableObject {
}
let code = (response as? HTTPURLResponse)?.statusCode ?? 0
switch code {
- case 200: break
+ case 200: return data
case 401, 403:
if keyState != .invalid { keyState = .invalid }
throw Failure.invalidKey
@@ -377,20 +505,17 @@ final class LingClient: ObservableObject {
debugLog("ling: HTTP \(code)")
throw Failure.http(code)
}
- guard let root = try JSONSerialization.jsonObject(with: data) as? [String: Any] else { throw Failure.parse }
- return root
}
// MARK: Start gate
- private static let spacing: TimeInterval = 0.6
private var lastStart = Date.distantPast
private var waiting: [(priority: Priority, seq: Int, resume: CheckedContinuation<Void, Never>)] = []
private var seq = 0
private var pumping = false
private func acquire(_ priority: Priority) async {
- if waiting.isEmpty && Date().timeIntervalSince(lastStart) >= Self.spacing {
+ if waiting.isEmpty && Date().timeIntervalSince(lastStart) >= provider.spacing {
lastStart = Date()
return
}
@@ -405,7 +530,7 @@ final class LingClient: ObservableObject {
private func pump() {
guard !pumping, !waiting.isEmpty else { return }
pumping = true
- let wait = max(0, Self.spacing - Date().timeIntervalSince(lastStart))
+ let wait = max(0, provider.spacing - Date().timeIntervalSince(lastStart))
DispatchQueue.main.asyncAfter(deadline: .now() + wait) { [weak self] in
MainActor.assumeIsolated {
guard let self else { return }
diff --git a/Sources/LiveSubs/NotesWindow.swift b/Sources/LiveSubs/NotesWindow.swift
index 49dc223..fcc7c5e 100644
--- a/Sources/LiveSubs/NotesWindow.swift
+++ b/Sources/LiveSubs/NotesWindow.swift
@@ -628,7 +628,7 @@ struct NotesWindowView: View {
private var keyEntry: some View {
VStack(alignment: .leading, spacing: 10) {
Text("生成纪要需要 API key").font(.system(size: 15, weight: .bold))
- Text("文字记录仍在正常保存。填入 Ling 的 key 后,会从头开始整理整场会议的内容。")
+ Text(L("文字记录仍在保存。填好 \(model.ling.provider.name) 的 key 后,会从头整理出整场纪要。"))
.font(.system(size: 12)).foregroundStyle(Palette.secondary).lineSpacing(2)
HStack(spacing: 8) {
SecureField("sk-…", text: $keyDraft)
@@ -639,10 +639,10 @@ struct NotesWindowView: View {
.onSubmit(saveKey)
SoftButton(L("保存并开始"), dark: true, action: saveKey)
}
- Button("获取 Ling key ↗") {
- if let url = URL(string: "https://chat.ant-ling.com/platform/api") { NSWorkspace.shared.open(url) }
+ if let site = model.ling.provider.site {
+ Button(L("获取 \(model.ling.provider.name) key ↗")) { NSWorkspace.shared.open(site) }
+ .buttonStyle(.plain).font(.system(size: 12)).foregroundStyle(Palette.secondary)
}
- .buttonStyle(.plain).font(.system(size: 12)).foregroundStyle(Palette.secondary)
}
.padding(16)
.background(RoundedRectangle(cornerRadius: 16).fill(Palette.raised))
diff --git a/Sources/LiveSubs/Onboarding.swift b/Sources/LiveSubs/Onboarding.swift
index cad62f3..b11c0e5 100644
--- a/Sources/LiveSubs/Onboarding.swift
+++ b/Sources/LiveSubs/Onboarding.swift
@@ -362,7 +362,7 @@ struct OnboardingView: View {
switch step {
case 1: permissions
case 2: tryIt
- case 3: OnboardingKeyStep(ling: model.ling, settings: settings, skipping: $model.onboardingKeySkip)
+ case 3: OnboardingKeyStep(model: model, ling: model.ling, settings: settings, skipping: $model.onboardingKeySkip)
case 4: speaking
default: closing
}
diff --git a/Sources/LiveSubs/OnboardingKey.swift b/Sources/LiveSubs/OnboardingKey.swift
index cecda5b..4ad8d81 100644
--- a/Sources/LiveSubs/OnboardingKey.swift
+++ b/Sources/LiveSubs/OnboardingKey.swift
@@ -4,34 +4,111 @@ import SwiftUI
/// Onboarding step 3: connect a Ling key. Notes, Ling translation and Ming voices all need it, but it
/// comes after the sample video, once people have seen what the app does. Skipping is allowed: "先不接"
/// first shows what still works and what waits for a key (the notes window asks again later).
+/// Ling is the whole path; "用不了 Ling?" opens another service as a way out, saying what it lacks.
struct OnboardingKeyStep: View {
+ @ObservedObject var model: AppModel
@ObservedObject var ling: LingClient
@ObservedObject var settings: AppSettings
/// "先不接" was clicked: the card shows what skipping leaves out until 回去接上 or 好,先这样.
@Binding var skipping: Bool
@State private var draft = ""
@State private var clipboardEmpty = false
+ /// Showing another service instead of Ling: follows the setting, so a change made in Settings
+ /// while this step is open (or a reused window) never leaves the Ling title over another service.
+ private var other: Bool { settings.provider.id != .ling }
+
+ private static let others: [AIProvider] = [.openrouter, .zenmux, .openai]
static let platform = URL(string: "https://chat.ant-ling.com/platform/api")!
var body: some View {
VStack(alignment: .leading, spacing: 18) {
- VStack(alignment: .leading, spacing: 8) {
- Text("接上 Ling,用上完整的知了").font(.system(size: 26, weight: .bold)).foregroundStyle(Palette.ink)
- Text("纪要、更准的翻译和自然的同传语音都靠它,约 1 分钟。")
- .font(.system(size: 14)).foregroundStyle(Palette.secondary)
+ if other && !skipping {
+ VStack(alignment: .leading, spacing: 8) {
+ Text("用其他服务").font(.system(size: 26, weight: .bold)).foregroundStyle(Palette.ink)
+ Text("纪要和翻译都能用,模型已经选好。").font(.system(size: 14)).foregroundStyle(Palette.secondary)
+ }
+ } else {
+ VStack(alignment: .leading, spacing: 10) {
+ Text("接上 Ling,一个 key 用上全部功能").font(.system(size: 26, weight: .bold)).foregroundStyle(Palette.ink)
+ HStack(spacing: 6) {
+ ForEach([L("实时纪要"), L("更准的翻译"), L("自然的同传声音"), L("用你自己的声音")], id: \.self) { item in
+ Text("✓ " + item).font(.system(size: 12, weight: .semibold)).foregroundStyle(Palette.ok)
+ .padding(.horizontal, 8).padding(.vertical, 3)
+ .background(RoundedRectangle(cornerRadius: 6).fill(Palette.okPale))
+ }
+ }
+ }
}
- if case .ok = ling.keyState { connected } else if skipping { withoutKey } else { entry }
- if !skipping {
+ if case .ok = ling.keyState { connected } else if skipping { withoutKey } else if other { otherEntry } else { entry }
+ if !skipping, !isConnected {
HStack(spacing: 10) {
- Text("Ling 每月赠送 ¥10 额度").font(.system(size: 12, weight: .semibold)).foregroundStyle(Palette.accentInk)
- .padding(.horizontal, 9).padding(.vertical, 3)
- .background(Capsule().fill(Palette.accentPale))
- Text("约够 10–50 小时会议")
- .font(.system(size: 12)).foregroundStyle(Palette.secondary)
+ if other {
+ Button(L("‹ 还是用 Ling")) { switchTo(.ling) }.buttonStyle(.plain)
+ .font(.system(size: 12)).foregroundStyle(Palette.secondary)
+ } else {
+ Text("Ling 每月赠送 ¥10 额度").font(.system(size: 12, weight: .semibold)).foregroundStyle(Palette.accentInk)
+ .padding(.horizontal, 9).padding(.vertical, 3)
+ .background(Capsule().fill(Palette.accentPale))
+ Text("约够 10–50 小时会议")
+ .font(.system(size: 12)).foregroundStyle(Palette.secondary)
+ Spacer()
+ Button(L("用不了 Ling?")) { switchTo(.openrouter) }.buttonStyle(.plain)
+ .font(.system(size: 12)).foregroundStyle(Palette.secondary).underline()
+ }
+ }
+ }
+ }
+ }
+
+ private var isConnected: Bool { if case .ok = ling.keyState { true } else { false } }
+
+ private func switchTo(_ p: AIProvider) {
+ draft = ""
+ clipboardEmpty = false
+ guard settings.aiProvider != p.id.rawValue else { return }
+ settings.aiProvider = p.id.rawValue
+ model.applyAIService()
+ }
+
+ // MARK: Another service
+
+ private var otherEntry: some View {
+ let p = settings.provider
+ return VStack(alignment: .leading, spacing: 14) {
+ HStack {
+ Segments(options: Self.others.map { ($0.id.rawValue, $0.name) }, value: p.id.rawValue) { id in
+ switchTo(AIProvider.named(id))
+ }
+ Spacer()
+ if let site = p.site {
+ Button { NSWorkspace.shared.open(site) } label: {
+ HStack(spacing: 5) {
+ Text(L("打开 \(p.name)"))
+ Image(systemName: "arrow.up.right").font(.system(size: 10, weight: .semibold))
+ }
+ .font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.ink)
+ .padding(.horizontal, 14).frame(height: 34)
+ .background(RoundedRectangle(cornerRadius: 9).fill(Palette.fill))
+ .contentShape(Rectangle())
+ }
+ .buttonStyle(.plain)
}
}
+ keyField(placeholder: L("粘贴 \(p.name) 的 key"))
+ status
+ HStack(spacing: 4) {
+ Text("少了:").foregroundStyle(Palette.secondary)
+ Text(p.hasVoices ? L("用你自己的声音") : L("自然的同传声音、你自己的声音")).fontWeight(.semibold).foregroundStyle(Palette.ink)
+ Text("(只有 Ling 支持)").foregroundStyle(Palette.secondary)
+ }
+ .font(.system(size: 12))
+ .padding(.horizontal, 10).padding(.vertical, 8).frame(maxWidth: .infinity, alignment: .leading)
+ .background(RoundedRectangle(cornerRadius: 8).fill(Palette.raised))
}
+ .padding(22)
+ .background(RoundedRectangle(cornerRadius: 16).fill(Color.white))
+ .overlay(RoundedRectangle(cornerRadius: 16).stroke(Palette.line, lineWidth: 1))
}
// MARK: Not connected yet
@@ -42,7 +119,7 @@ struct OnboardingKeyStep: View {
number(1)
VStack(alignment: .leading, spacing: 2) {
Text("在 Ling 开放平台创建 key").font(.system(size: 15, weight: .semibold)).foregroundStyle(Palette.ink)
- Text("注册或登录后点“创建令牌”").font(.system(size: 12)).foregroundStyle(Palette.tertiary)
+ Text("国内直接注册,不用代理;登录后点“创建令牌”").font(.system(size: 12)).foregroundStyle(Palette.tertiary)
}
Spacer()
Button { NSWorkspace.shared.open(Self.platform) } label: {
@@ -63,25 +140,7 @@ struct OnboardingKeyStep: View {
number(2)
VStack(alignment: .leading, spacing: 10) {
Text("复制 sk- 开头的 key,回来粘贴").font(.system(size: 15, weight: .semibold)).foregroundStyle(Palette.ink)
- HStack(spacing: 8) {
- SecureField("sk-…", text: $draft)
- .textFieldStyle(.plain).font(.system(size: 13, design: .monospaced))
- .padding(.horizontal, 12).frame(height: 36)
- .background(RoundedRectangle(cornerRadius: 10).fill(Color.white))
- .overlay(RoundedRectangle(cornerRadius: 10).stroke(Palette.ink.opacity(0.35), lineWidth: 1))
- .onSubmit { save(draft) }
- Button(action: pasteAndCheck) {
- HStack(spacing: 6) {
- Image(systemName: "doc.on.clipboard").font(.system(size: 12))
- Text(draft.isEmpty ? L("粘贴并检查") : L("保存并检查"))
- }
- .font(.system(size: 13, weight: .semibold)).foregroundStyle(.white)
- .padding(.horizontal, 14).frame(height: 36)
- .background(RoundedRectangle(cornerRadius: 10).fill(Palette.ink))
- .contentShape(Rectangle())
- }
- .buttonStyle(.plain)
- }
+ keyField(placeholder: "sk-…")
status
}
}
@@ -102,9 +161,10 @@ struct OnboardingKeyStep: View {
line(Palette.error, why, Palette.accentInk)
default:
if clipboardEmpty {
- line(Palette.error, L("剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。"), Palette.accentInk)
+ line(Palette.error, other ? L("剪贴板里没有 sk- 开头的 key,请先去 \(settings.provider.name) 复制。")
+ : L("剪贴板里没有 sk- 开头的 key,先在 Ling 开放平台复制。"), Palette.accentInk)
} else {
- Label("只保存在这台 Mac 上,只发给 Ling", systemImage: "lock")
+ Label(L("只保存在这台 Mac 上,只发给 \(settings.provider.name)"), systemImage: "lock")
.font(.system(size: 12)).foregroundStyle(Palette.tertiary)
}
}
@@ -119,7 +179,7 @@ struct OnboardingKeyStep: View {
.frame(width: 24, height: 24).background(Circle().fill(Palette.okPale))
Text("已连接").font(.system(size: 16, weight: .semibold)).foregroundStyle(Palette.ink)
if case .ok(let s) = ling.keyState {
- Text(L("\(settings.aiModel) · 响应约 \(String(format: "%.1f", s)) 秒"))
+ Text(L("\(settings.textModel) · 响应约 \(String(format: "%.1f", s)) 秒"))
.font(.system(size: 12)).foregroundStyle(Palette.secondary)
}
Spacer()
@@ -132,7 +192,7 @@ struct OnboardingKeyStep: View {
HStack(spacing: 10) {
benefit(L("实时纪要"), L("会中每 45 秒更新"))
benefit(L("更准的翻译"), L("人名、术语前后一致"))
- benefit(L("自然人声"), L("同传约 2 秒出声"))
+ if ling.speaks { benefit(L("自然人声"), L("同传约 2 秒出声")) }
}
Text("开会时,纪要会跟着字幕一起更新。").font(.system(size: 12)).foregroundStyle(Palette.secondary)
}
@@ -176,6 +236,28 @@ struct OnboardingKeyStep: View {
.background(RoundedRectangle(cornerRadius: 12).fill(fill))
}
+ private func keyField(placeholder: String) -> some View {
+ HStack(spacing: 8) {
+ SecureField(placeholder, text: $draft)
+ .textFieldStyle(.plain).font(.system(size: 13, design: .monospaced))
+ .padding(.horizontal, 12).frame(height: 36)
+ .background(RoundedRectangle(cornerRadius: 10).fill(Color.white))
+ .overlay(RoundedRectangle(cornerRadius: 10).stroke(Palette.ink.opacity(0.35), lineWidth: 1))
+ .onSubmit { save(draft) }
+ Button(action: pasteAndCheck) {
+ HStack(spacing: 6) {
+ Image(systemName: "doc.on.clipboard").font(.system(size: 12))
+ Text(draft.isEmpty ? L("粘贴并检查") : L("保存并检查"))
+ }
+ .font(.system(size: 13, weight: .semibold)).foregroundStyle(.white)
+ .padding(.horizontal, 14).frame(height: 36)
+ .background(RoundedRectangle(cornerRadius: 10).fill(Palette.ink))
+ .contentShape(Rectangle())
+ }
+ .buttonStyle(.plain)
+ }
+ }
+
// MARK: Pieces
private func number(_ n: Int) -> some View {
diff --git a/Sources/LiveSubs/Settings.swift b/Sources/LiveSubs/Settings.swift
index 94e5caa..105fd76 100644
--- a/Sources/LiveSubs/Settings.swift
+++ b/Sources/LiveSubs/Settings.swift
@@ -100,6 +100,54 @@ final class AppSettings: ObservableObject {
@Published var aiModel: String {
didSet { save() }
}
+ /// The AI service: an `AIProvider.Kind` ("ling" unless the user picked another).
+ @Published var aiProvider: String {
+ didSet { save() }
+ }
+ /// Text and speech model per service other than Ling ("openrouter": "qwen/qwen3.8-flash"); a
+ /// service not listed uses its first recommended model. "custom" in `aiVoiceModels` is the
+ /// custom service's speech model, empty for none.
+ @Published var aiModels: [String: String] {
+ didSet { save() }
+ }
+ @Published var aiVoiceModels: [String: String] {
+ didSet { save() }
+ }
+ /// The custom service: its address (an OpenAI-compatible `/v1`), and optionally another
+ /// address for speech (empty: the same one) and the voice to ask for.
+ @Published var aiCustomBase: String {
+ didSet { save() }
+ }
+ @Published var aiCustomVoiceBase: String {
+ didSet { save() }
+ }
+ @Published var aiCustomVoice: String {
+ didSet { save() }
+ }
+
+ var provider: AIProvider { AIProvider.named(aiProvider) }
+
+ /// What `LingClient` calls with: the service, its address and models.
+ var aiConfig: AIConfig {
+ let p = provider
+ switch p.id {
+ case .ling:
+ return AIConfig(provider: p, base: p.base, textModel: aiModel, voiceModel: p.voiceModels.first?.id, voiceBase: p.base)
+ case .custom:
+ let base = AIProvider.customBase(aiCustomBase)
+ let voice = (aiVoiceModels["custom"] ?? "").trimmingCharacters(in: .whitespaces)
+ let voiceBase = aiCustomVoiceBase.isEmpty ? base : AIProvider.customBase(aiCustomVoiceBase)
+ let name = aiCustomVoice.trimmingCharacters(in: .whitespaces)
+ return AIConfig(provider: p, base: base, textModel: aiModels["custom"] ?? "", voiceModel: voice.isEmpty ? nil : voice,
+ voiceBase: voiceBase, customVoice: name.isEmpty ? nil : name)
+ default:
+ return AIConfig(provider: p, base: p.base, textModel: aiModels[p.id.rawValue] ?? p.textModels.first?.id ?? "",
+ voiceModel: p.hasVoices ? aiVoiceModels[p.id.rawValue] ?? p.voiceModels.first?.id : nil, voiceBase: p.base)
+ }
+ }
+
+ /// The text model in use, for display.
+ var textModel: String { aiConfig.textModel }
/// End the meeting when the meeting app it was heard through hangs up.
@Published var endWithApp: Bool {
@@ -166,6 +214,12 @@ final class AppSettings: ObservableObject {
talkKey = Shortcut(stored: defaults.string(forKey: "talkKey")) ?? .defaultTalk
toggleKey = Shortcut(stored: defaults.string(forKey: "toggleKey")) ?? .defaultToggle
aiModel = defaults.string(forKey: "aiModel") ?? "Ling-3.1-flash"
+ aiProvider = defaults.string(forKey: "aiProvider") ?? "ling"
+ aiModels = defaults.dictionary(forKey: "aiModels") as? [String: String] ?? [:]
+ aiVoiceModels = defaults.dictionary(forKey: "aiVoiceModels") as? [String: String] ?? [:]
+ aiCustomBase = defaults.string(forKey: "aiCustomBase") ?? ""
+ aiCustomVoiceBase = defaults.string(forKey: "aiCustomVoiceBase") ?? ""
+ aiCustomVoice = defaults.string(forKey: "aiCustomVoice") ?? ""
displayMode = defaults.string(forKey: "displayMode") ?? "notes"
speakVoices = defaults.dictionary(forKey: "speakVoices") as? [String: String] ?? [:]
endWithApp = defaults.object(forKey: "endWithApp") as? Bool ?? true
@@ -209,6 +263,12 @@ final class AppSettings: ObservableObject {
defaults.set(talkKey.stored, forKey: "talkKey")
defaults.set(toggleKey.stored, forKey: "toggleKey")
defaults.set(aiModel, forKey: "aiModel")
+ defaults.set(aiProvider, forKey: "aiProvider")
+ defaults.set(aiModels, forKey: "aiModels")
+ defaults.set(aiVoiceModels, forKey: "aiVoiceModels")
+ defaults.set(aiCustomBase, forKey: "aiCustomBase")
+ defaults.set(aiCustomVoiceBase, forKey: "aiCustomVoiceBase")
+ defaults.set(aiCustomVoice, forKey: "aiCustomVoice")
defaults.set(displayMode, forKey: "displayMode")
defaults.set(speakVoices, forKey: "speakVoices")
defaults.set(endWithApp, forKey: "endWithApp")
diff --git a/Sources/LiveSubs/SettingsWindow.swift b/Sources/LiveSubs/SettingsWindow.swift
index 5379b49..3f3b2c7 100644
--- a/Sources/LiveSubs/SettingsWindow.swift
+++ b/Sources/LiveSubs/SettingsWindow.swift
@@ -430,6 +430,7 @@ struct SettingsView: View {
HStack {
Text(model.settingsSection.title).font(.system(size: 20, weight: .bold)).foregroundStyle(Palette.ink)
Spacer()
+ if model.settingsSection == .ai { AIServiceMenu(model: model, settings: settings) }
if model.settingsSection == .speak {
Toggle("把我说的翻译给对方", isOn: Binding(get: { settings.speakEnabled }, set: { model.enableSpeaking($0) }))
.toggleStyle(.switch).labelsHidden().tint(Palette.ink)
@@ -441,7 +442,7 @@ struct SettingsView: View {
case .language: LanguageSettings(model: model, settings: settings)
case .records: records
case .ai: AISettingsView(model: model, ling: model.ling, settings: settings)
- case .diagnostics: DiagnosticsView(diagnostics: model.diagnostics, model: settings.aiModel)
+ case .diagnostics: DiagnosticsView(diagnostics: model.diagnostics, model: settings.textModel)
}
}
.padding(.leading, 12).padding(.trailing, 28).padding(.top, 40).padding(.bottom, 28)
diff --git a/Sources/LiveSubs/SpeakEngine.swift b/Sources/LiveSubs/SpeakEngine.swift
index b65d385..dd27122 100644
--- a/Sources/LiveSubs/SpeakEngine.swift
+++ b/Sources/LiveSubs/SpeakEngine.swift
@@ -491,6 +491,8 @@ final class SpeakEngine {
/// Set by the app: the voice chosen for a language.
var route: ((String) -> VoiceRoute)?
+ /// Who speaks a stream, for logs and the test ("ming", or the service: "zenmux").
+ var streamName: () -> String = { "ming" }
/// Returns after the audio has played. A stream that fails before any audio falls back to the
/// Mac's voice, so the room always hears the sentence.
@@ -500,9 +502,10 @@ final class SpeakEngine {
lastDevice = override ?? outputDevice()
switch forced ?? route?(language) ?? .system(nil) {
case .stream(let make):
- lastVoice = "ming"
+ let name = streamName()
+ lastVoice = name
if await speakStream(make(text), device: override ?? outputDevice()) { return }
- lastVoice = "system (ming failed)"
+ lastVoice = "system (\(name) failed)"
case .system(let id):
lastVoice = "system"
voiceID = id
diff --git a/Sources/LiveSubs/SpeakTestView.swift b/Sources/LiveSubs/SpeakTestView.swift
index 9aabc76..8159d92 100644
--- a/Sources/LiveSubs/SpeakTestView.swift
+++ b/Sources/LiveSubs/SpeakTestView.swift
@@ -144,7 +144,10 @@ struct SpeakTestView: View {
}
private func voiceName(_ r: SpeakTestResult) -> String {
- let v = r.voice.hasPrefix("ming") ? "Ming" : r.voice.contains("failed") ? L("本机(Ming 未成功)") : L("本机声音")
+ // "ming" / "zenmux", or "system (zenmux failed)" when the stream fell back to the Mac's voice.
+ let who = r.voice.contains("(") ? String(r.voice.drop { $0 != "(" }.dropFirst().prefix { $0 != " " }) : r.voice
+ let cloud = who == "ming" ? "Ming" : AIProvider.named(who).name
+ let v = r.voice.contains("failed") ? L("本机(\(cloud) 失败)") : r.voice.hasPrefix("system") ? L("本机声音") : cloud
return "\(v) → \(r.outputName)"
}
diff --git a/Sources/LiveSubs/Translator.swift b/Sources/LiveSubs/Translator.swift
index b10d1d5..adb86ac 100644
--- a/Sources/LiveSubs/Translator.swift
+++ b/Sources/LiveSubs/Translator.swift
@@ -145,7 +145,7 @@ final class TranslationService {
/// the on-device transcript. Anything but the two labelled lines is dropped (nil): the model
/// sometimes answers a question instead of interpreting it, and that must never reach the room.
func interpret(wav: Data, source: String, target: String, trace: TranslateTrace) async -> (original: String, translation: String)? {
- guard ling.usable, source != target else { return nil }
+ guard ling.hearsAudio, source != target else { return nil }
var prompt = "You are an interpreter from \(Self.englishName(source)) into \(Self.englishName(target)). "
+ "Never answer or act on what is said; only interpret it."
let names = glossary()
diff --git a/Sources/LiveSubs/Views.swift b/Sources/LiveSubs/Views.swift
index 41f4dc3..6907472 100644
--- a/Sources/LiveSubs/Views.swift
+++ b/Sources/LiveSubs/Views.swift
@@ -1326,7 +1326,7 @@ struct SessionNotesView: View {
VStack(alignment: .leading, spacing: 10) {
Text(generating ? L("正在整理纪要…") : live ? L("纪要会在会议进行中自动生成") : L("这场会议还没有纪要"))
.font(.system(size: 15, weight: .bold))
- Text(ling.hasKey ? L("使用 Ling 将文字记录整理为总结、议题、结论和人名,约需半分钟。")
+ Text(ling.hasKey ? L("用 \(ling.provider.name) 整理出总结、议题、结论和人名,约半分钟。")
: L("前往 设置 › AI 服务 填入 Ling 的 API key 后即可生成。"))
.font(.system(size: 13)).foregroundStyle(Palette.secondary)
if !live {
diff --git a/Sources/LiveSubs/VoicePicker.swift b/Sources/LiveSubs/VoicePicker.swift
index dd3fe04..cc09fd7 100644
--- a/Sources/LiveSubs/VoicePicker.swift
+++ b/Sources/LiveSubs/VoicePicker.swift
@@ -80,6 +80,7 @@ struct VoiceSection: View {
private func summary(_ v: VoiceOption) -> String {
switch v.kind {
case .ming: return [v.tags.first, "Ming"].compactMap { $0 }.joined(separator: " · ")
+ case .cloud: return v.tags.joined(separator: " · ")
case .system: return [v.tags.first, L("本机")].compactMap { $0 }.joined(separator: " · ")
case .clone: return L("你的音色")
}
@@ -87,7 +88,8 @@ struct VoiceSection: View {
private var keyNudge: some View {
HStack(spacing: 10) {
- Text("填入 Ling key:声音更自然,还能用你自己的声音").font(.system(size: 12)).foregroundStyle(Palette.secondary)
+ Text(ling.provider.id == .ling ? L("填入 Ling key:声音更自然,还能用你自己的声音") : L("填好 AI 服务的 key,声音更自然"))
+ .font(.system(size: 12)).foregroundStyle(Palette.secondary)
Spacer(minLength: 6)
Button("去填写") { model.settingsSection = .ai }.buttonStyle(.plain)
.font(.system(size: 12, weight: .semibold)).foregroundStyle(Palette.ink)
@@ -131,13 +133,13 @@ struct VoiceSection: View {
private func row(_ v: VoiceOption) -> some View {
let selected = chosen == v.id
- let usable = !v.needsKey || ling.usable
+ let usable = !v.needsKey || ling.speaks
return Button { if usable { model.setVoice(v.id, for: language) } } label: {
HStack(spacing: 10) {
playButton(v.id, highlighted: selected, enabled: usable) { model.previewVoice(v.id, language: language) }
Text(v.name).font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.ink).lineLimit(1)
.frame(width: 88, alignment: .leading)
- Text(usable ? v.tags.prefix(2).joined(separator: " · ") + (v.needsKey ? " · Ming" : "") : L("需要 Ling key"))
+ Text(usable ? v.tags.prefix(2).joined(separator: " · ") + (v.id.hasPrefix("ming:") ? " · Ming" : "") : L("需要 key"))
.font(.system(size: 12)).foregroundStyle(Palette.secondary).lineLimit(1)
Spacer(minLength: 6)
Text(v.needsKey ? L("慢约 1 秒") : L("最快")).font(.system(size: 11)).foregroundStyle(Palette.tertiary)
@@ -176,9 +178,26 @@ struct VoiceSection: View {
private var cloneRow: some View {
let has = VoiceReference.exists && cloneVersion >= 0
let selected = chosen == "clone"
+ if !ling.provider.clones {
+ HStack(spacing: 10) {
+ ZStack {
+ Circle().fill(Palette.fill)
+ Image(systemName: "mic").font(.system(size: 12)).foregroundStyle(Palette.tertiary)
+ }
+ .frame(width: 28, height: 28)
+ VStack(alignment: .leading, spacing: 2) {
+ Text("我自己的声音").font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.secondary)
+ Text("只有 Ling 能用你自己的声音").font(.system(size: 11)).foregroundStyle(Palette.tertiary)
+ }
+ Spacer(minLength: 6)
+ SoftButton(L("去换成 Ling")) { model.settingsSection = .ai }
+ }
+ .padding(.horizontal, 10).padding(.vertical, 8)
+ .background(Palette.raised)
+ } else {
HStack(spacing: 10) {
if has {
- playButton("clone", highlighted: selected, enabled: ling.usable) { model.previewVoice("clone", language: language) }
+ playButton("clone", highlighted: selected, enabled: ling.clones) { model.previewVoice("clone", language: language) }
} else {
ZStack {
Circle().fill(Palette.accentPale)
@@ -207,15 +226,16 @@ struct VoiceSection: View {
}
Spacer(minLength: 6)
if has {
- Button { if ling.usable { model.setVoice("clone", for: language) } } label: { Radio(on: selected) }
- .buttonStyle(.plain).disabled(!ling.usable)
+ Button { if ling.clones { model.setVoice("clone", for: language) } } label: { Radio(on: selected) }
+ .buttonStyle(.plain).disabled(!ling.clones)
.accessibilityLabel(L("用我自己的声音"))
} else {
- SoftButton(L("录制")) { recording = true }.disabled(!ling.usable)
+ SoftButton(L("录制")) { recording = true }.disabled(!ling.clones)
}
}
.padding(.horizontal, 10).padding(.vertical, 8)
.background(selected ? Palette.accentWash : Palette.raised)
+ }
}
private var cloneNote: String {
@@ -224,7 +244,8 @@ struct VoiceSection: View {
}
private var footnote: String {
- ling.usable ? L("Ling 不可用时自动换成本机声音") : L("填入 Ling key 后可用 Ming 声音和你自己的声音")
+ if ling.provider.id != .ling { return ling.speaks ? L("\(ling.provider.name) 用不了时,自动换本机声音") : L("这个服务不出声音,用本机声音") }
+ return ling.usable ? L("Ling 不可用时自动换成本机声音") : L("填入 Ling key 后可用 Ming 声音和你自己的声音")
}
}
@@ -351,7 +372,7 @@ struct VoiceCloneSheet: View {
}
}
.overlay(RoundedRectangle(cornerRadius: 14).stroke(Palette.line, lineWidth: 1))
- if !model.ling.usable {
+ if !model.ling.clones {
Text("需先在“AI 服务”中填入 Ling key,才能使用你自己的声音。").font(.system(size: 12)).foregroundStyle(Palette.error)
}
Text("听起来不像或有杂音?换个安静的地方重录一次。录音仅保存在本机,可随时删除。")
@@ -404,7 +425,7 @@ struct VoiceCloneSheet: View {
}
private func playClone() {
- guard model.ling.usable, let data = try? Data(contentsOf: recorder.url) else { return }
+ guard model.ling.clones, let data = try? Data(contentsOf: recorder.url) else { return }
clonePlaying = true
let ref = (audio: "data:audio/wav;base64," + data.base64EncodedString(), text: recorder.transcript)
let lang = VoiceCatalog.mingLanguage(for: language)
diff --git a/Sources/LiveSubs/Voices.swift b/Sources/LiveSubs/Voices.swift
index 5d9bc96..4764f41 100644
--- a/Sources/LiveSubs/Voices.swift
+++ b/Sources/LiveSubs/Voices.swift
@@ -3,15 +3,16 @@ import Foundation
// MARK: - Catalog
-/// A voice the room can hear: one of Ming's (through the Ling key), a voice installed on this Mac,
-/// or the user's own voice cloned from a recording.
+/// A voice the room can hear: one of Ming's (through the Ling key), one of another service's speech
+/// model, a voice installed on this Mac, or the user's own voice cloned from a recording.
struct VoiceOption: Identifiable, Equatable {
enum Kind: Equatable {
case ming(String)
+ case cloud(String)
case system(String)
case clone
}
- /// Stored in settings: "ming:US_Emma", "system:<AVSpeechSynthesisVoice identifier>", "clone".
+ /// Stored in settings: "ming:US_Emma", "cloud:Kore", "system:<AVSpeechSynthesisVoice identifier>", "clone".
let id: String
let name: String
let tags: [String]
@@ -25,6 +26,15 @@ struct VoiceOption: Identifiable, Equatable {
/// George speak it with `language_id`. The Mac's own best female and male voices follow, so there is
/// always something without a key.
enum VoiceCatalog {
+ /// The cloud voices of the AI service in use. Set by the app when the service changes.
+ enum Service: Equatable {
+ case ming
+ /// `label`: where they come from, shown next to each ("Gemini").
+ case cloud(label: String, voices: [CloudVoice])
+ case none
+ }
+ nonisolated(unsafe) static var service: Service = .ming
+
/// Tabs in settings: (key, title). The key is the translation code without region ("zh" for zh-CN / zh-TW).
static let languages: [(key: String, title: String)] = [
("en", "English"), ("zh", "中文"), ("ja", "日本語"), ("ko", "한국어"),
@@ -78,11 +88,22 @@ enum VoiceCatalog {
return out
}
- static func options(for language: String) -> [VoiceOption] { ming(for: language) + system(for: language) }
+ /// The service's voices for a language: Ming's, a speech model's (the same in every language), or none.
+ static func remote(for language: String) -> [VoiceOption] {
+ switch service {
+ case .ming: return ming(for: language)
+ case .cloud(let label, let voices):
+ return voices.map { VoiceOption(id: "cloud:\($0.id)", name: $0.id, tags: [$0.gender, label].filter { !$0.isEmpty },
+ kind: .cloud($0.id)) }
+ case .none: return []
+ }
+ }
+
+ static func options(for language: String) -> [VoiceOption] { remote(for: language) + system(for: language) }
- /// What a language uses until the user picks: Ming's first voice with a key, else the Mac's.
+ /// What a language uses until the user picks: the service's first voice with a key, else the Mac's.
static func defaultID(for language: String, hasKey: Bool) -> String? {
- (hasKey ? ming(for: language).first : nil)?.id ?? system(for: language).first?.id
+ (hasKey ? remote(for: language).first : nil)?.id ?? system(for: language).first?.id
}
static let cloneOption = VoiceOption(id: "clone", name: L("我自己的声音"), tags: [], kind: .clone)
diff --git a/Tests/LiveSubsTests/AIProviderTests.swift b/Tests/LiveSubsTests/AIProviderTests.swift
new file mode 100644
index 0000000..d5724f3
--- /dev/null
+++ b/Tests/LiveSubsTests/AIProviderTests.swift
@@ -0,0 +1,55 @@
+import Foundation
+import Testing
+@testable import LiveSubs
+
+struct AIProviderTests {
+ private func shaped(_ p: AIProvider) -> [String: Any] {
+ var body: [String: Any] = [:]
+ AIConfig(provider: p, base: p.base, textModel: "m").shape(&body, maxTokens: 50)
+ return body
+ }
+
+ @Test func eachServiceTurnsThinkingOffItsOwnWay() {
+ #expect((shaped(.ling)["thinking"] as? [String: String])?["type"] == "disabled")
+ #expect((shaped(.zenmux)["reasoning"] as? [String: Bool])?["enabled"] == false)
+ #expect((shaped(.openrouter)["reasoning"] as? [String: Bool])?["enabled"] == false)
+ let openai = shaped(.openai)
+ #expect(openai["reasoning_effort"] as? String == "none")
+ #expect(openai["max_completion_tokens"] as? Int == 50)
+ #expect(openai["max_tokens"] == nil && openai["temperature"] == nil)
+ let custom = shaped(.custom)
+ #expect(custom["max_tokens"] as? Int == 50 && custom["thinking"] == nil && custom["reasoning"] == nil)
+ }
+
+ @Test func customAddressNeedsHTTPSExceptOnThisMac() {
+ #expect(AIProvider.customBase("https://api.example.com/v1")?.absoluteString == "https://api.example.com/v1/")
+ #expect(AIProvider.customBase("api.example.com/v1")?.scheme == "https")
+ #expect(AIProvider.customBase("http://localhost:11434/v1")?.absoluteString == "http://localhost:11434/v1/")
+ #expect(AIProvider.customBase("localhost:1234/v1")?.scheme == "http")
+ #expect(AIProvider.customBase("http://api.example.com/v1") == nil)
+ #expect(AIProvider.customBase(" ") == nil)
+ }
+
+ @Test func onlyLingClonesAndHearsAudio() {
+ for p in AIProvider.all { #expect(p.clones == (p.id == .ling) && p.hearsAudio == (p.id == .ling)) }
+ #expect(!AIProvider.openai.hasVoices && AIProvider.zenmux.hasVoices && AIProvider.openrouter.hasVoices)
+ }
+
+ @Test func wavHeaderIsStripped() {
+ var wav = Data("RIFF".utf8) + Data([36, 0, 0, 0]) + Data("WAVE".utf8)
+ wav += Data("fmt ".utf8) + Data([16, 0, 0, 0]) + Data(repeating: 0, count: 16)
+ wav += Data("data".utf8) + Data([4, 0, 0, 0]) + Data([1, 2, 3, 4])
+ #expect(LingClient.pcm(fromWAV: wav) == Data([1, 2, 3, 4]))
+ #expect(LingClient.pcm(fromWAV: Data([9, 9])) == Data([9, 9]))
+ }
+
+ @Test func catalogKeepsTextModelsRecommendedFirst() throws {
+ let json = """
+ {"data":[{"id":"z/chat","output_modalities":["text"]},{"id":"g/tts","output_modalities":["speech"]},
+ {"id":"a/chat","architecture":{"output_modalities":["text"]}},{"id":"g/flash:batch"},{"id":"text-embedding-3-small"},
+ {"id":"qwen3:14b"},{"id":"rec/one"}]}
+ """
+ let ids = AIConfig.textModels(fromCatalog: Data(json.utf8), recommended: ["rec/one"])
+ #expect(ids == ["rec/one", "a/chat", "qwen3:14b", "z/chat"])
+ }
+}
diff --git a/Tests/LiveSubsTests/LingTests.swift b/Tests/LiveSubsTests/LingTests.swift
index 57133c4..0f7a2a8 100644
--- a/Tests/LiveSubsTests/LingTests.swift
+++ b/Tests/LiveSubsTests/LingTests.swift
@@ -94,6 +94,16 @@ final class LingStub: URLProtocol, @unchecked Sendable {
#expect(AIKey.read() == nil)
}
+ @Test func eachServiceHasItsOwnKeyFile() throws {
+ #expect(AIKey.save("sk-ling-111", "ling"))
+ #expect(AIKey.save("sk-zen-222", "zenmux"))
+ let file = folder.appendingPathComponent("ai-key-zenmux")
+ #expect(try FileManager.default.attributesOfItem(atPath: file.path)[.posixPermissions] as? Int == 0o600)
+ #expect(AIKey.read("ling") == "sk-ling-111" && AIKey.read("zenmux") == "sk-zen-222" && AIKey.read("openai") == nil)
+ AIKey.remove("zenmux")
+ #expect(AIKey.read("zenmux") == nil && AIKey.read() == "sk-ling-111")
+ }
+
@Test func maskedShowsOnlyTheEnds() {
#expect(AIKey.masked("sk-abcdefghij3f9a") == "sk-" + String(repeating: "•", count: 12) + "3f9a")
#expect(AIKey.masked("short") == "sk-…")
diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md
index 470339c..4943d27 100644
--- a/docs/ROADMAP.md
+++ b/docs/ROADMAP.md
@@ -9,7 +9,6 @@ In rough order, and subject to change. Tell us what you need in Issues.
- **Developer ID signing and notarization.** Removes the "Open Anyway" prompt on first launch and stores the AI key in the macOS Keychain.
- **Speaker recognition.** Speaker identification (experimental, since 1.0) already tells the other side's voices apart within a meeting, lets you rename them and names to-do owners, but forgets them when the meeting ends. Next, Cicada will remember frequent meeting participants by voice so they're named in the next meeting too. Because voiceprints are biometric data, they stay on your Mac, require opt-in, and can be deleted anytime.
- **Local notes without an API key.** Use Apple's on-device model to generate meeting notes on supported Macs, keeping all audio and text local.
-- **Custom AI providers.** Support any OpenAI-compatible API endpoint besides Ling.
**Later**
- **Live voice changing.** No translation: your voice goes into the meeting as a different voice, changed as you speak, without holding the talk key. Setting "I speak" and "They hear" to the same language already swaps the voice today, but it goes through text, so the room hears it only after you let go and your tone is lost.
diff --git a/site/changelog.json b/site/changelog.json
index cce9873..1ed1a41 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -6,6 +6,11 @@
"summary": "实时纪要窗口重新排版,纪要落后时说清楚还差多少;说话人的名字在实时纪要里就能改。",
"image": null,
"items": [
+ {
+ "kind": "new",
+ "title": "用不了 Ling 时可以换成 OpenRouter、ZenMux、OpenAI 或任何 OpenAI 兼容服务。",
+ "text": "在设置 › AI 服务右上角切换,纪要和整句翻译都能用,模型已经按效果和价格选好;OpenRouter 和 ZenMux 还能用 Gemini 的自然人声做同传。一步语音翻译和声音克隆仍然只有 Ling 有。"
+ },
{
"kind": "fixed",
"title": "macOS 14 和 15 上,往上翻实时文字记录时不再被拉回最新一句。",