Doubao-powered voice input for Linux, Wayland and Omarchy
docs: explain Volcengine bidirectional ASR setup
quanruc058e37a7393
diff --git a/.gitignore b/.gitignoreindex b342bae..8313730 100644--- a/.gitignore+++ b/.gitignore@@ -74,7 +74,9 @@ settings.json*.buildinfo# Local working notes and assistant configuration (not product documentation)-/docs/+/docs/*+!/docs/volcengine-asr.md+!/docs/volcengine-asr.zh-CN.md/CLAUDE.md/.claude//.codex/diff --git a/README.md b/README.mdindex cf74d74..f8f0cfb 100644--- a/README.md+++ b/README.md@@ -54,6 +54,10 @@ the key. Service activation and project access are managed in the Volcengineconsole; an HTTP 401 from **Test API key** normally means that account-side accessis not ready yet.+See [Doubao and the official Volcengine speech API](docs/volcengine-asr.md) for+backend differences, new-console activation, bidirectional streaming limitations,+and troubleshooting.+### Optional voice polishingTurn on the **Voice polishing · Experimental** switch on the Trigger key page to configure andiff --git a/README.zh-CN.md b/README.zh-CN.mdindex 1b806ef..38363c2 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -41,6 +41,9 @@ API Key 保存在 `~/.config/doubao-say/volcengine_api_key`(或对应的安装包或测试报告。清除凭证会删除该 Key。服务开通和项目权限需在火山引擎控制台管理;若“测试 API Key”返回 HTTP 401,通常表示账号侧访问权限尚未就绪。+两种识别方式的区别、新版控制台开通步骤、双向流式限制与排障方法见+[豆包与火山引擎官方语音识别](docs/volcengine-asr.zh-CN.md)。+### 可选语音润色在“快捷键”页面打开**语音润色 · 实验特性**开关,可配置 OpenAI 兼容的 Base URL、API Key、模型和diff --git a/docs/volcengine-asr.md b/docs/volcengine-asr.mdnew file mode 100644index 0000000..f188586--- /dev/null+++ b/docs/volcengine-asr.md@@ -0,0 +1,60 @@+# Doubao and the official Volcengine speech API++Doubao Say supports two cloud recognition backends. Neither is an offline local model: microphone audio is sent to the selected provider while recording.++| Backend | Requirements | Trade-off |+| --- | --- | --- |+| Doubao web sign-in (default) | A Doubao account and saved web session | No separate Volcengine API purchase, but it relies on an unofficial web protocol that can change |+| Official Volcengine API | A Volcengine account, Streaming Speech Recognition 2.0 activation, and an API key | Official authentication, live partial text, and separately metered usage |++Final text is pasted into the target application only after recording ends. “Live” means that the Doubao Say overlay displays incremental recognition while you speak.++## Doubao web sign-in++Keep **Doubao account** selected on the Recognition step, complete sign-in in the web window, then run the microphone and voice tests. This mode doesn't require a Volcengine console account or API key. Credentials are stored locally, but availability can be affected by changes to the Doubao website.++## Enable Volcengine bidirectional streaming ASR 2.0++These instructions apply to the **new Doubao Speech console**. Do not enter the App ID and Access Token described by legacy-console documentation.++1. Sign in to the [Volcengine console](https://console.volcengine.com/) and complete any required account verification.+2. Open the [new Doubao Speech activation page](https://console.volcengine.com/speech/new/setting/activate).+3. Select a project, such as `default`. Service activation and the API key must belong to the same project; resources are isolated between projects.+4. Under **Activation management**, find **Streaming Speech Recognition 2.0** in the large-model section.+5. Activate the service and accept any billing agreement shown by the console. The console displays remaining trial or purchased audio-processing time; limits and prices depend on the account.+6. Open **API Key** in the same project and create or copy a key. Treat it as a long-lived secret.++Volcengine describes bidirectional streaming as returning text while speech is still being received. The mode used by Doubao Say primarily supports Chinese and English; don't assume other languages or the broader non-bidirectional dialect coverage is available.++Official references:++- [Streaming ASR product description](https://www.volcengine.com/docs/6561/1354871?lang=zh)+- [Bidirectional streaming ASR WebSocket](https://docs.volcengine.com/docs/6561/2630027?lang=zh)++## Configure Doubao Say++1. Open **Settings → Recognition service**.+2. Select **Volcengine official API**.+3. Paste the API key. It saves automatically.+4. Select **Test API key**. A successful test verifies authentication and entitlement without uploading a recording.+5. Run the real voice test. Incremental text should appear in the overlay before recording finishes.++Doubao Say supplies these values internally; users don't need to configure them:++```text+WebSocket: wss://openspeech.bytedance.com/api/v3/sauc/bigmodel+Resource ID: volc.seedasr.sauc.duration+Auth header: X-Api-Key+Audio: 16 kHz / 16-bit / mono PCM+```++The key is stored at `~/.config/doubao-say/volcengine_api_key` with owner-only permissions. Switching back to Doubao web sign-in keeps the key; **Clear API key** removes it.++## Troubleshooting++- **HTTP 401:** verify that the key comes from the new console, its project matches the activated service, and Streaming Speech Recognition 2.0 is active. Newly created access may take a short time to propagate.+- **Key test passes but no transcript appears:** verify the selected microphone with the local three-second microphone test, then run the real voice test.+- **Text appears only after release:** use a current build whose endpoint ends in `bigmodel`, not `bigmodel_nostream`.+- **Unexpected charges or quota errors:** inspect Usage statistics and the billing center in the Volcengine console. Doubao Say never purchases quota or adds funds for you.++Never publish an API key, configuration directory, VM disk, or full logs containing private transcripts. A timestamp, HTTP status, and Volcengine Log ID are normally sufficient for support.diff --git a/docs/volcengine-asr.zh-CN.md b/docs/volcengine-asr.zh-CN.mdnew file mode 100644index 0000000..e7a2583--- /dev/null+++ b/docs/volcengine-asr.zh-CN.md@@ -0,0 +1,66 @@+# 豆包与火山引擎官方语音识别++豆包说提供两种云端语音识别方式。两者都不是本地离线模型,录音时都会把音频发送给对应的服务商,但账号、鉴权和计费方式不同。++| 方式 | 需要什么 | 费用与稳定性 | 适合谁 |+| --- | --- | --- | --- |+| 豆包网页登录(默认) | 豆包账号和网页会话 | 无需单独购买火山引擎 API;依赖豆包网页协议,可能随网站变更 | 希望快速开始、不想管理云 API 的个人用户 |+| 火山引擎官方 API | 火山引擎账号、已开通的流式语音识别 2.0、API Key | 按火山引擎账号的试用额度、资源包或后付费规则计费;接口和鉴权由官方提供 | 需要正式 API、实时增量文字和独立用量管理的用户 |++无论选择哪一种方式,最终文本仍只在录音结束后一次粘贴到目标应用;“实时”指录音悬浮窗会边说边显示增量识别文字。++## 使用豆包网页登录++1. 打开豆包说,在“语音识别”步骤保留“豆包账号”。+2. 点击登录,在应用打开的网页窗口中完成豆包登录。+3. 返回豆包说,完成麦克风检测和“试说一句”。+4. 设置触发键并完成设置。++登录凭证保存在本机。该方式使用豆包网页服务,不需要火山引擎控制台、API Key 或单独充值。它是非官方网页协议接入,豆包网站的登录或协议变化可能影响可用性。++## 开通火山引擎双向流式语音识别 2.0++以下步骤适用于火山引擎**新版豆包语音控制台**。不要使用旧版文档中的 App ID、Access Token 或应用列表来配置豆包说。++1. 登录[火山引擎控制台](https://console.volcengine.com/),按控制台要求完成账号认证。+2. 进入[新版豆包语音控制台](https://console.volcengine.com/speech/new/setting/activate)。+3. 在页面顶部选择项目,例如 `default(默认项目)`。服务和 API Key 必须属于同一个项目;不同项目的资源相互隔离。+4. 打开左侧的“开通管理”,在“大模型”中找到“流式语音识别 2.0”。+5. 点击开通、增购或按控制台提示确认计费协议,直到服务显示“已开通”。页面会显示剩余试用或已购音频处理时长;具体额度、有效期和价格以你的控制台为准。+6. 打开左侧的“API Key”,在同一项目下创建或复制一个 API Key。API Key 是长期凭证,不要发到 Issue、聊天、日志或截图中。++火山引擎把双向流式模式定义为“边说话边出文字”。豆包说使用 Seed ASR 2.0 小时版资源,当前双向模式主要支持中文和英文。其他语种或更完整的方言覆盖不能假定可用,请以火山引擎最新说明为准。++官方参考:++- [大模型流式语音识别产品说明](https://www.volcengine.com/docs/6561/1354871?lang=zh)+- [双向流式语音识别 WebSocket](https://docs.volcengine.com/docs/6561/2630027?lang=zh)++## 在豆包说中配置++1. 打开“设置 → 语音识别服务”。+2. 选择“火山引擎官方 API”。+3. 粘贴刚才创建的 API Key。修改会自动保存,不需要额外点击保存。+4. 点击“测试 API Key”。看到“API Key 可用”只代表鉴权和服务权限正常,不会上传录音。+5. 回到引导页执行“试说一句”。说话过程中应在悬浮窗看到增量文字,结束后得到最终结果。++豆包说会在内部使用以下官方参数,普通用户不需要手工填写:++```text+WebSocket: wss://openspeech.bytedance.com/api/v3/sauc/bigmodel+Resource ID: volc.seedasr.sauc.duration+Auth header: X-Api-Key+Audio: 16 kHz / 16-bit / mono PCM+```++API Key 保存在 `~/.config/doubao-say/volcengine_api_key`,文件权限仅允许当前用户读取。切回豆包网页登录不会删除 Key;使用“清除 API Key”才会删除它。++## 验证与排障++- **HTTP 401 / API Key 被拒绝**:确认 Key 来自新版豆包语音控制台,Key 所属项目与开通服务的项目一致,并确认“流式语音识别 2.0”已开通。刚开通或刚创建的 Key 也可能需要短暂等待生效。+- **测试 Key 成功,但没有文字**:检查麦克风选择并运行三秒麦克风检测;该检测只在本机执行。随后再运行真实的“试说一句”。+- **结束后有文字,但录音期间没有增量文字**:确认使用的是包含双向接口的当前版本;接口路径应为 `bigmodel`,而不是 `bigmodel_nostream`。+- **偶发空结果**:说话时间过短、输入设备错误或音量过低都可能导致空结果。先持续说一个完整短句再测试。+- **担心费用**:在新版控制台的“用量统计”或费用中心查看消耗、剩余额度和欠费状态。豆包说不会替你购买资源或充值。++不要把 VM 磁盘、配置目录、API Key 或包含私人转写内容的完整日志上传到公开 Issue。反馈问题时可提供错误时间、HTTP 状态码和火山引擎返回的 Log ID。