dsh-gsv-tts 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  本文件记录 dsh-gsv-tts 的所有版本更新。格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [5.3.0] - 2026-11-14
6
+
7
+ ### 官方语音(DeepSeek)
8
+ - 新增第三种 TTS 提供方 `deepseek`:调用 `https://api.deepseek.com/v1/tools/tts`,音色 `stella`(海星)/ `tide`(暗潮),10 种语种按文本自动识别
9
+ - 设置面板新增「官方语音(DeepSeek)」模式;**默认零填写**:通过 `ctx.get('credentials')` 按 `deepseekApiKeyEnv`(默认 `DEEPSEEK_API_KEY`)从 Harness 凭据服务复用模型鉴权那份 Key,不再要求用户重新粘贴
10
+ - 可选 `deepseekApiKey` 手填覆盖(用独立额度);凭据服务缺失/异常时回退同名环境变量;引用名留空则完全不查凭据
11
+ - 官方接口返回完整 WAV:提供方逐段解出 16-bit PCM;短文本装 WAV 落盘,整段朗读边收边写文件(RIFF/data 长度回填),内存不随文本线性增长
12
+ - 单段合成带真实时长(按采样参数换算),进度条可用
13
+ - 「整段播放 / 下载」支持官方语音:`/speak/full` 走 `synthesizeLong`,一次落盘可 seek
14
+ - **修复切换卡顿**:设置面板切到官方语音需等约 1 秒——切换前先 `await` 音色请求,且当时健康探活是真实试合成(1–4 秒),新请求排在它后面。现改为:先本地切换(零等待),官方音色用内置列表(不发请求),Edge 音色拉取一次后缓存,健康探活改用免费 `GET /models`(实测 110–300ms,且不再计费)
15
+ - 切换时把 `defaultVoice` 与 `provider` 一并落定,避免配置快照刷新把下拉冲回旧值
16
+ - 官方语音不参与本地引擎启停与预热;无 Key 时健康检查返回明确提示,不静默失败
17
+ - **未发布**:等实机音质 / 首音延迟 / 实际扣费实测通过后再定版本号
18
+
5
19
  ## [5.2.0] - 2026-11-10
6
20
 
7
21
  ### Edge 在线端点
package/CHANGELOG_EN.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to dsh-gsv-tts are documented in this file. Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## [5.3.0] - 2026-11-14
6
+
7
+ ### Official voices (DeepSeek TTS)
8
+ - Third TTS provider `deepseek`: calls `https://api.deepseek.com/v1/tools/tts` with voices `stella` and `tide`; language is auto-detected from the text
9
+ - New "Official (DeepSeek)" mode; **zero setup**: resolves the key from the Harness credentials service via `ctx.get('credentials')` using `deepseekApiKeyEnv` (default `DEEPSEEK_API_KEY`) — the same credential as model auth, so no re-pasting
10
+ - Optional `deepseekApiKey` overrides it (separate quota); a missing/unavailable credential service falls back to the same-named environment variable, and an empty reference name skips credentials entirely
11
+ - The API returns complete WAV audio: the provider extracts 16-bit PCM per request; short text is written as one WAV, while full reads stream to disk with RIFF/data sizes backfilled, so memory does not grow with text length
12
+ - Per-segment synthesis reports real duration (derived from sample format) for the progress bar
13
+ - "Full audio / download" supports official voices through `synthesizeLong` on `/speak/full`
14
+ - **Fix switching lag**: switching to Official Voices in settings took ~1s because the tab awaited a voices request while the health probe was a real 1–4s synthesis, queueing behind it. Now the tab switches locally with zero waiting, official voices come from a built-in list, the Edge list is cached, and health uses a free `GET /models` (measured 110–300ms, no billing)
15
+ - Persist `defaultVoice` together with `provider` on switch so a config snapshot refresh cannot reset the dropdown
16
+ - Official voices never start or warm up the local engine; a missing key produces an explicit health message instead of a silent failure
17
+ - **Not released**: wait for real-device quality / latency / billing checks before choosing a version number
18
+
5
19
  ## [5.2.0] - 2026-11-10
6
20
 
7
21
  ### Edge online endpoint
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-gsv-tts
2
2
 
3
- > 为 DSH(DeepSeek Harness)接入语音朗读能力 —— 双模式可选:**云端快速体验**(Edge,免安装、装上即听)+ **本地专业**(GSV-TTS-Lite,音色克隆、完全离线)。
3
+ > 为 DSH(DeepSeek Harness)接入语音朗读能力 —— 三模式可选:**云端快速体验**(Edge,免安装、装上即听)+ **本地专业**(GSV-TTS-Lite,音色克隆、完全离线)+ **官方语音**(DeepSeek TTS,按字符计费、复用已有 Key)。
4
4
 
5
5
  ![CI](https://img.shields.io/github/actions/workflow/status/TaoruiLiu19/dsh-gsv/ci.yml?branch=master&label=CI&logo=github)
6
6
  ![npm](https://img.shields.io/npm/v/dsh-gsv-tts)
@@ -8,6 +8,7 @@
8
8
  ![License](https://img.shields.io/npm/l/dsh-gsv-tts)
9
9
  [![Listed on awesome-dsh-plugin](https://img.shields.io/badge/Listed%20on-awesome--dsh--plugin.com-8B5CF6?style=flat-square)](https://awesome-dsh-plugin.com/p/TaoruiLiu19/dsh-gsv/)
10
10
  [![Voice Market](https://img.shields.io/badge/%E9%9F%B3%E8%89%B2%E5%B8%82%E5%9C%BA-Voice%20Market-10b981?style=flat-square)](https://taoruiliu19.github.io/gsv-market/)
11
+ [![DSH Insights health](https://dsh-insights.com/badge/TaoruiLiu19/dsh-gsv.svg)](https://dsh-insights.com/p/TaoruiLiu19/dsh-gsv/?utm_source=badge&utm_medium=readme&utm_campaign=TaoruiLiu19/dsh-gsv)
11
12
 
12
13
  音色市场:[taoruiliu19.github.io/gsv-market](https://taoruiliu19.github.io/gsv-market/) · 投稿指南:[docs/VOICE_MARKET.md](docs/VOICE_MARKET.md)
13
14
 
@@ -18,6 +19,7 @@ English README: [README_EN.md](README_EN.md) · 变更记录: [CHANGELOG.md](CHA
18
19
  ## ✨ 功能亮点
19
20
 
20
21
  - 🌐 **云端快速体验(Edge)**:**零配置、装上即用**,无需 Python / 模型 / 引擎;20+ 种免费自然语言音色(晓晓、云希、Aria 等),联网即用,出声较快
22
+ - ☁️ **官方语音(DeepSeek)**:官方 TTS 接口,音色 `stella`(海星)/ `tide`(暗潮),10 种语种按文本自动识别;按字符计费(刊例 3 元/万字符,汉字算 2 字符),复用已有 DeepSeek Key,**非默认模式**
21
23
  - 🖥️ **本地专业(GSV)**:按参考音频**克隆目标音色**、**完全离线**;由云端简单模式一键升级引导而来
22
24
  - 🔊 **一键朗读**:每条助手消息旁的 🔊 按钮直接朗读(自动排除思考内容);长回复**流式播放**(首块到达即出声,不再等整段合成完),带暂停/继续/停止与进度显示,正在朗读的消息会高亮
23
25
  - ⚡ **首音更快**:可选**常驻模式(性能优先)**,插件加载后自动启动并预热默认音色;朗读走**流式 WAV**,长回复首音明显更快。默认**节能模式(资源优先)**,不后台占资源(与旧版一致)
@@ -31,12 +33,13 @@ English README: [README_EN.md](README_EN.md) · 变更记录: [CHANGELOG.md](CHA
31
33
 
32
34
  ---
33
35
 
34
- ## 🎯 快速上手(两种模式,任选其一)
36
+ ## 🎯 快速上手(三种模式,任选其一)
35
37
 
36
38
  | 你的诉求 | 用哪种 | 怎么开始 |
37
39
  |---|---|---|
38
40
  | "我就想**装上就能听**" | 🌐 **快速体验(Edge)** | 见下方「一、快速体验模式」——**无需任何安装** |
39
41
  | "我要**克隆自己的声音 / 完全离线**" | 🖥️ **本地专业(GSV)** | 见下方「二、本地专业模式」 |
42
+ | "我**已经有 DeepSeek Key**,想走官方通道" | ☁️ **官方语音(DeepSeek)** | 见下方「三、官方语音模式」——填 Key 即可,**按字符计费** |
40
43
 
41
44
  > **默认模式**:全新安装默认为 **Edge 快速体验**(联网即用);**从旧版本升级的老用户仍保持 GSV 本地模式、声音不变**,可随时在设置面板切换。
42
45
  >
@@ -62,6 +65,20 @@ English README: [README_EN.md](README_EN.md) · 变更记录: [CHANGELOG.md](CHA
62
65
 
63
66
  > 本地模式全程离线运行,支持音色克隆,不依赖网络与云端配额。
64
67
 
68
+ ### 三、官方语音模式(DeepSeek,按量计费)
69
+
70
+ 1. 安装插件并重启 DSH
71
+ 2. 打开 设置 → 声音设置 → **TTS 模式**选 **官方语音(DeepSeek)**
72
+ 3. **无需填 Key**:插件默认复用 Harness 凭据服务里的 `DEEPSEEK_API_KEY`(就是模型设置里保存的那份,两者同一凭据);只有想用另一份额度时,才在“DeepSeek API Key”里手填覆盖
73
+ 4. 音色下拉选 **海星(stella,女声)** 或 **暗潮(tide,男声)**,可先点「试听」对比
74
+ 5. 点任意助手消息旁的 🔊,或让 agent 调用 `tts_speak`
75
+
76
+ > **复用了什么**:插件通过 `ctx.get('credentials')` 按引用名解析 Key(默认 `DEEPSEEK_API_KEY`,可在“凭据名称”里改)。所以 Harness 里能正常对话,这里就能直接朗读;如果 Harness 只用了账号登录、没有保存 API Key,健康提示会告诉你先去模型设置里保存 Key(或导出同名环境变量)。若 Harness 用 `DEEPSEEK_BASE_URL` 指向网关,插件也沿用该地址请求 `/v1/tools/tts`。
77
+
78
+ > **计费提醒**:官方接口按字符计费(刊例 3 元/万字符,汉字算 2 个字符,即 1000 汉字约 0.6 元;限时五折约 0.3 元)。开启**自动朗读**会持续产生费用,请按需开启。官方语音不支持调速、音色克隆与自定义音色,需要这些能力请用本地 GSV 模式。
79
+ >
80
+ > **Key 存储**:默认不往插件配置写 Key——用的是 Harness 凭据存储里的那份(`.credentials.yaml`,本就由 Harness 明文管理);手填的 Key 才会进入插件配置。
81
+
65
82
  ## 📦 安装
66
83
 
67
84
  两种方式任选其一,然后在设置中启用:
@@ -86,33 +103,35 @@ dsh plugin --profile web add "github:TaoruiLiu19/dsh-gsv"
86
103
 
87
104
  | 项 | 说明 |
88
105
  |---|---|
89
- | 如何切换 | 设置 → 声音设置 → **TTS 模式**(快速体验 / 本地专业),切换即时生效 |
90
- | 配置项 | `provider: 'edge' \| 'gsv'`(初始化分派,建议经设置面板切换,勿手动改) |
106
+ | 如何切换 | 设置 → 声音设置 → **TTS 模式**(快速体验 / 官方语音 / 本地专业),切换即时生效 |
107
+ | 配置项 | `provider: 'edge' \| 'deepseek' \| 'gsv'`(建议经设置面板切换,勿手动改) |
91
108
  | 老用户升级 | 无 `provider` 字段的旧配置:**有音色预设 → 保持 `gsv` 本地模式,声音不变** |
92
109
  | 全新安装 | 无音色预设 → 默认 `edge` 云端简单模式,联网即用 |
93
110
  | 写入时机 | 首次启动判定后写回一次(`settings.update`),之后不再改写 |
94
111
  | `schemaVersion` | 配置结构版本,迁移守卫的落点 |
95
112
 
96
- > Edge 模式需联网;若云端不可用,面板会提示"云端通道拥挤 / 暂不可用",本地 GSV 模式始终可用作降级。
113
+ > Edge / 官方语音模式需联网;若云端不可用,面板会提示"云端通道拥挤 / 暂不可用",本地 GSV 模式始终可用作降级。
97
114
 
98
115
  ---
99
116
 
100
117
  ## 🏗️ 系统架构
101
118
 
102
- ![dsh-gsv-tts 系统构成与数据流](docs/images/architecture.png)
119
+ ![dsh-gsv-tts 系统构成与三 provider 数据流](docs/images/architecture.png)
103
120
 
104
121
  > 📖 交互式架构图:[打开 dsh-gsv-tts.architecture.html](docs/architecture/dsh-gsv-tts.architecture.html)(支持缩放、聚焦、主题切换)
105
122
 
106
- **双 provider 架构**:`TTSService` 按 `config.provider` 分发到云端(Edge)或本地(GSV),朗读主链路与工具调用两条路径对两种 provider 一致。
123
+ **三 provider 架构**:`TTSService` 按 `config.provider` 分发到云端(Edge)、官方(DeepSeek)或本地(GSV),朗读主链路与工具调用两条路径对三种 provider 一致。
107
124
 
108
- - 🔊 **朗读主链路(经 webServer)**:用户点击 🔊 → DSH Web 客户端 → `webServer` 的 `/speak` 路由 → `TTSService` 按 provider 请求 → 云端/本地引擎返回音频块 → `AudioStore` 落盘 → 同源短链接回传浏览器播放。
125
+ - 🔊 **朗读主链路(经 webServer)**:用户点击 🔊 → DSH Web 客户端 → `webServer` 的 `/speak` 路由 → `TTSService` 按 provider 请求 → 云端 / 官方 / 本地引擎返回音频 → `AudioStore` 落盘 → 同源短链接回传浏览器播放(首段 30 字,逐段即到即播)。
109
126
  - 🤖 **Agent 工具调用(宿主内直连)**:Agent 调用 `tts_speak` 等工具时,由宿主进程内 tools 服务**直接**执行,**不经 webServer HTTP 网关**。
127
+ - 🔑 **凭据复用**:官方语音通过 Harness 的 `ctx.get('credentials')` 解析 `DEEPSEEK_API_KEY`,与模型鉴权同一份凭据,插件配置里不落 Key。
110
128
 
111
129
  | 构成 | 说明 |
112
130
  |------|------|
113
- | DSH 应用(DeepSeek Harness) | 插件宿主:Web 客户端、webServer、settings 服务 |
131
+ | DSH 应用(DeepSeek Harness) | 插件宿主:Web 客户端、webServer、settings 服务、credentials 凭据服务 |
114
132
  | dsh-gsv-tts 插件 | `TTSService`(按 provider 分发)/ `AudioStore`(落盘)/ 引擎管理(启停·安装·健康检查) |
115
133
  | Edge provider | `edge-tts-universal`,微软精选网络音色,返回 MP3 流(浏览器解码) |
134
+ | DeepSeek provider | 官方 `POST /v1/tools/tts`,海星 / 暗潮两个音色,返回 16-bit PCM WAV(重新装头落盘,长文本边收边写) |
116
135
  | GSV-TTS-Lite 本地引擎 | 本机 Python 进程,FastAPI :9880,真流式 `/tts/stream`,返回 WAV |
117
136
 
118
137
  ## 📸 截图
@@ -204,17 +223,19 @@ dsh plugin --profile web add "github:TaoruiLiu19/dsh-gsv"
204
223
 
205
224
  | 字段 | 说明 | 默认值 |
206
225
  |------|------|--------|
207
- | TTS 模式 | 快速体验(Edge 云端,免安装)/ 本地专业(GSV,离线/克隆) | 老用户 `gsv` / 新装 `edge` |
226
+ | TTS 模式 | 快速体验(Edge 云端,免安装)/ 官方语音(DeepSeek,按量计费)/ 本地专业(GSV,离线/克隆) | 老用户 `gsv` / 新装 `edge` |
208
227
  | 引擎开关 | 启动/停止 GSV-TTS-Lite 引擎进程 | 关 |
209
228
  | `engineMode` | 引擎启动方式:`always` 常驻模式(性能优先,自动启动+预热)/ `eco` 节能模式(资源优先,不后台启动,与旧版一致) | `eco` |
210
229
  | `apiUrl` | 引擎 API 地址 | `http://localhost:9880` |
211
- | `defaultVoice` | 默认音色(gsv=预设名 / edge=云端音色 id,留空用第一个) | 空 |
230
+ | `defaultVoice` | 默认音色(gsv=预设名 / edge=云端音色 id / deepseek=`stella`\|`tide`,留空用第一个) | 空 |
231
+ | `deepseekApiKey` | 可选:手填 API Key,覆盖 Harness 凭据(用另一份额度时填) | 空 |
232
+ | `deepseekApiKeyEnv` | 凭据引用名,决定复用 Harness 里的哪份 Key;留空则不查凭据服务 | `DEEPSEEK_API_KEY` |
212
233
  | `timeout` | 请求超时(毫秒) | `30000` |
213
234
  | `installDir` | 引擎安装目录 | `./GSV-TTS-Lite` |
214
235
  | `autoPlay` | 自动朗读助手回复 | `false` |
215
236
  | `interruptOnNew` | 自动朗读时新回复是否打断当前朗读(关闭则朗读中跳过,避免叠音) | `true` |
216
237
  | `voiceRegistryUrl` | 音色市场远端清单地址(默认指向在线试听站点;留空仅用包内离线清单) | 站点 URL |
217
- | `provider` | `gsv` \| `edge`(初始化分派,勿手动改;设置面板切换) | 见"TTS 模式" |
238
+ | `provider` | `gsv` \| `edge` \| `deepseek`(勿手动改;设置面板切换) | 见"TTS 模式" |
218
239
  | `schemaVersion` | 配置结构版本(迁移守卫落点) | `1` |
219
240
  | `quotaDaily` | 云端简单模式每日配额(`null`=不限量,仅引导用) | `null` |
220
241
  | `voices` | 音色预设列表 | 空 |
@@ -256,6 +277,7 @@ dsh plugin --profile web add "github:TaoruiLiu19/dsh-gsv"
256
277
  - 配置 Schema:`@deepseek-ai/schemastery`(volatile 字段 + 就地热更新)
257
278
  - 设置面板:宿主 `settings` 服务(`describe`/`update`)+ 客户端 `configForms` 服务 + `settings.section` 插槽
258
279
  - 云端 Provider:`edge-tts-universal`(微软网络音色,MP3 流)
280
+ - 官方 Provider:DeepSeek 官方 TTS(`/v1/tools/tts`,WAV),凭据走 Harness `credentials` 服务
259
281
  - 本地引擎:GSV-TTS-Lite 0.4.7
260
282
  - 语言:TypeScript(宿主)/ 手写客户端 bundle(浏览器)/ Python(本地流式 API)
261
283
 
@@ -280,6 +302,8 @@ pnpm publish # 发布到 npm(files: lib, scripts, cordis.patch.yml)
280
302
  - 播放为 markdown 链接点击播放;内嵌 `<audio>` 需客户端扩展(规划中)
281
303
  - 合成音频存于系统临时目录(`%TEMP%/dsh-gsv-tts`),启动清空、会话内最多 200 个
282
304
  - Edge 云端模式依赖网络;微软限量限流时可能不可用(已有降级引导)
305
+ - 官方语音按字符计费(约 0.3 元/千汉字),且不支持调速、音色克隆与自定义音色;自动朗读会持续产生费用
306
+ - 官方语音需要 Harness 里已保存 `DEEPSEEK_API_KEY`(或同名环境变量);只用账号登录、没有 API Key 时会提示补 Key
283
307
  - `tts_setup_engine` 通过 `child_process` 执行 pip/git,需环境有对应工具
284
308
  - `promptText` 留空依赖引擎 ASR 能力(能力探测),不支持时合成报错
285
309
 
package/README_EN.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-gsv-tts
2
2
 
3
- > Adds text-to-speech read-aloud to DSH (DeepSeek Harness) — dual-mode: **Cloud Quick Mode** (Edge, zero install, read as soon as it's added) + **Local Pro Mode** (GSV-TTS-Lite, voice cloning, fully offline).
3
+ > Adds text-to-speech read-aloud to DSH (DeepSeek Harness) — three modes: **Cloud Quick Mode** (Edge, zero install, read as soon as it's added) + **Local Pro Mode** (GSV-TTS-Lite, voice cloning, fully offline) + **Official Voices** (DeepSeek TTS, billed per character, reuses your existing key).
4
4
 
5
5
  ![CI](https://img.shields.io/github/actions/workflow/status/TaoruiLiu19/dsh-gsv/ci.yml?branch=master&label=CI&logo=github)
6
6
  ![npm](https://img.shields.io/npm/v/dsh-gsv-tts)
@@ -8,6 +8,7 @@
8
8
  ![License](https://img.shields.io/npm/l/dsh-gsv-tts)
9
9
  [![Listed on awesome-dsh-plugin](https://img.shields.io/badge/Listed%20on-awesome--dsh--plugin.com-8B5CF6?style=flat-square)](https://awesome-dsh-plugin.com/p/TaoruiLiu19/dsh-gsv/)
10
10
  [![Voice Market](https://img.shields.io/badge/Voice%20Market-dsh--gsv-10b981?style=flat-square)](https://taoruiliu19.github.io/gsv-market/)
11
+ [![DSH Insights health](https://dsh-insights.com/badge/TaoruiLiu19/dsh-gsv.svg)](https://dsh-insights.com/p/TaoruiLiu19/dsh-gsv/?utm_source=badge&utm_medium=readme&utm_campaign=TaoruiLiu19/dsh-gsv)
11
12
 
12
13
  Voice Market: [taoruiliu19.github.io/gsv-market](https://taoruiliu19.github.io/gsv-market/) · Submission guide: [docs/VOICE_MARKET.md](docs/VOICE_MARKET.md)
13
14
 
@@ -18,6 +19,7 @@ Voice Market: [taoruiliu19.github.io/gsv-market](https://taoruiliu19.github.io/g
18
19
  ## ✨ Features
19
20
 
20
21
  - 🌐 **Cloud Quick Mode (Edge)**: **zero configuration, ready to use** — no Python / models / engines needed; 20+ free natural voices (Xiaoxiao, Yunxi, Aria, etc.), online and fast to first audio
22
+ - ☁️ **Official Voices (DeepSeek)**: the official TTS endpoint with `stella` (female) and `tide` (male), auto-detecting 10 languages; billed per character (CNY 3 per 10k characters, a Chinese character counts as 2), reusing your DeepSeek key — **not the default mode**
21
23
  - 🖥️ **Local Pro Mode (GSV)**: **clone a target voice from a reference audio**, **fully offline**; guided one-step upgrade from Cloud Quick Mode
22
24
  - 🔊 **One-click read-aloud**: a 🔊 button next to every assistant message (reasoning content excluded); long replies are **streamed** (first chunk starts playback; no need to wait for the whole reply), with Pause/Resume/Stop controls, a progress readout, and a highlight on the message being read
23
25
  - ⚡ **Faster first audio**: **Always-on mode (performance)** starts and pre-warms the engine with the plugin; read-aloud uses a **streaming WAV**, so first audio on long replies is much faster. The default **Eco mode (resources first)** does not run in the background, same as before
@@ -31,12 +33,13 @@ Voice Market: [taoruiliu19.github.io/gsv-market](https://taoruiliu19.github.io/g
31
33
 
32
34
  ---
33
35
 
34
- ## 🎯 Quick Start (either mode)
36
+ ## 🎯 Quick Start (any of the three modes)
35
37
 
36
38
  | What you want | Which mode | How to begin |
37
39
  |---|---|---|
38
40
  | "I just want it to **read as soon as it's installed**" | 🌐 **Quick Mode (Edge)** | See "Quick Mode (Edge)" below — **no installation needed** |
39
41
  | "I want to **clone my own voice / be fully offline**" | 🖥️ **Local Pro Mode (GSV)** | See "Local Pro Mode (GSV)" below |
42
+ | "I **already have a DeepSeek key** and want the official channel" | ☁️ **Official Voices (DeepSeek)** | See "Official Voices (DeepSeek)" below — paste the key, **billed per character** |
40
43
 
41
44
  > **Default mode**: fresh installs default to **Edge Quick Mode** (works online); **existing users upgrading keep GSV local mode with voices unchanged**, and can switch anytime in the settings panel.
42
45
  >
@@ -62,6 +65,20 @@ Voice Market: [taoruiliu19.github.io/gsv-market](https://taoruiliu19.github.io/g
62
65
 
63
66
  > Local Pro mode runs fully offline and supports voice cloning — independent of network and cloud quotas.
64
67
 
68
+ ### Official Voices (DeepSeek, billed per character)
69
+
70
+ 1. Install the plugin and restart DSH
71
+ 2. Open Settings → Voice Settings → **TTS Mode** → select **Official (DeepSeek)**
72
+ 3. **No key needed**: the plugin resolves `DEEPSEEK_API_KEY` from the Harness credentials service by default — the same credential saved in model settings. Fill the optional key field only to bill a different quota
73
+ 4. Pick **Stella (female)** or **Tide (male)**; use "Preview" to compare them
74
+ 5. Click the 🔊 next to any assistant message, or have the agent call `tts_speak`
75
+
76
+ > **What is reused**: `ctx.get('credentials')` resolves the key by reference name (default `DEEPSEEK_API_KEY`, editable under "Credential name"). If the Harness only uses account sign-in with no API key stored, the health line tells you to save a key in model settings (or export the env var).
77
+ >
78
+ > **Billing**: the official endpoint charges per character (CNY 3 per 10k characters; a Chinese character counts as 2, so ~CNY 0.6 per 1000 Chinese characters, ~CNY 0.3 at the current 50% discount). **Auto-read keeps generating cost** — enable it deliberately. Official voices do not support rate control, cloning or custom voices; use Local Pro for those.
79
+ >
80
+ > **Key storage**: nothing is written to the plugin config by default — the Harness credential store (`.credentials.yaml`, already managed by the Harness) supplies the key; only a manually entered key lands in plugin config.
81
+
65
82
  ## 📦 Installation
66
83
 
67
84
  Choose one of the two methods, then enable it in Settings:
@@ -86,8 +103,8 @@ After installing, restart DSH. The tools register automatically and a "Voice Set
86
103
 
87
104
  | Item | Description |
88
105
  |---|---|
89
- | How to switch | Settings → Voice Settings → **TTS Mode** (Quick / Local Pro), applied instantly |
90
- | Config field | `provider: 'edge' \| 'gsv'` (assigned at init; switch from the settings panel rather than editing manually) |
106
+ | How to switch | Settings → Voice Settings → **TTS Mode** (Quick / Official / Local Pro), applied instantly |
107
+ | Config field | `provider: 'edge' \| 'deepseek' \| 'gsv'` (switch from the settings panel rather than editing manually) |
91
108
  | Existing users upgrading | Old config with no `provider` field: **voices present → stays `gsv` local mode, voices unchanged** |
92
109
  | Fresh installs | No voices → defaults to `edge` cloud Quick mode, ready online |
93
110
  | When it is written | Resolved once on first boot and persisted via `settings.update`; never rewritten afterwards |
@@ -99,20 +116,22 @@ After installing, restart DSH. The tools register automatically and a "Voice Set
99
116
 
100
117
  ## 🏗️ Architecture
101
118
 
102
- ![dsh-gsv-tts system composition & data flow](docs/images/architecture.png)
119
+ ![dsh-gsv-tts system composition & three-provider data flow](docs/images/architecture.png)
103
120
 
104
121
  > 📖 Interactive diagram: [open dsh-gsv-tts.architecture.html](docs/architecture/dsh-gsv-tts.architecture.html) (zoom, focus, theme switching)
105
122
 
106
- **Dual-provider architecture**: `TTSService` dispatches to the cloud (Edge) or local (GSV) provider by `config.provider`; the read-aloud main path and the tool-call path are identical for both providers.
123
+ **Three-provider architecture**: `TTSService` dispatches to the cloud (Edge), official (DeepSeek), or local (GSV) provider by `config.provider`; the read-aloud main path and the tool-call path are identical for all three.
107
124
 
108
- - 🔊 **Read-aloud path (via webServer)**: user clicks 🔊 → DSH Web client → the `webServer` `/speak` route → `TTSService` requests via the active provider → cloud/local engine returns audio chunks → `AudioStore` saves them → a same-origin short link is returned to the browser for playback.
125
+ - 🔊 **Read-aloud path (via webServer)**: user clicks 🔊 → DSH Web client → the `webServer` `/speak` route → `TTSService` requests via the active provider → cloud / official / local engine returns audio → `AudioStore` saves it → a same-origin short link is returned to the browser (first segment is 30 chars, so playback starts early).
109
126
  - 🤖 **Agent tool calls (in-process, direct)**: when the agent calls `tts_speak` and friends, the host's in-process tools service executes the plugin logic **directly — no webServer HTTP gateway involved**.
127
+ - 🔑 **Credential reuse**: Official Voices resolves `DEEPSEEK_API_KEY` through the Harness `ctx.get('credentials')` service — the same credential as model auth, so no key is stored in plugin config.
110
128
 
111
129
  | Part | Description |
112
130
  |------|-------------|
113
- | DSH app (DeepSeek Harness) | Plugin host: Web client, webServer, settings service |
131
+ | DSH app (DeepSeek Harness) | Plugin host: Web client, webServer, settings service, credentials service |
114
132
  | dsh-gsv-tts plugin | `TTSService` (provider dispatch) / `AudioStore` (storage) / engine manager (start-stop · setup · health check) |
115
133
  | Edge provider | `edge-tts-universal`, curated Microsoft web voices, returns an MP3 stream (decoded by the browser) |
134
+ | DeepSeek provider | Official `POST /v1/tools/tts`, Stella/Tide voices, returns 16-bit PCM WAV (re-wrapped and written to disk) |
116
135
  | GSV-TTS-Lite local engine | Local Python process, FastAPI :9880, true streaming `/tts/stream`, returns WAV |
117
136
 
118
137
  ## 📸 Screenshots
@@ -204,17 +223,19 @@ Download and inject voices from the Voice Market in one click — no need to fil
204
223
 
205
224
  | Field | Description | Default |
206
225
  |-------|-------------|---------|
207
- | TTS Mode | Quick (Edge cloud, zero setup) / Local Pro (GSV, offline & cloning) | existing users `gsv` / fresh installs `edge` |
226
+ | TTS Mode | Quick (Edge cloud, zero setup) / Official (DeepSeek, billed) / Local Pro (GSV, offline & cloning) | existing users `gsv` / fresh installs `edge` |
208
227
  | Engine switch | Start/stop the GSV-TTS-Lite engine process | Off |
209
228
  | `engineMode` | Engine startup: `always` = Always-on (performance, auto-start + pre-warm) / `eco` = Eco (resources first, no background start, same as before) | `eco` |
210
229
  | `apiUrl` | Engine API URL | `http://localhost:9880` |
211
- | `defaultVoice` | Default voice (gsv=preset name / edge=cloud voice id; empty = first) | empty |
230
+ | `defaultVoice` | Default voice (gsv=preset name / edge=cloud voice id / deepseek=`stella`\|`tide`; empty = first) | empty |
231
+ | `deepseekApiKey` | Optional manual key that overrides the Harness credential | empty |
232
+ | `deepseekApiKeyEnv` | Credential reference name; empty skips the credential service | `DEEPSEEK_API_KEY` |
212
233
  | `timeout` | Request timeout (ms) | `30000` |
213
234
  | `installDir` | Engine install directory | `./GSV-TTS-Lite` |
214
235
  | `autoPlay` | Auto-read assistant replies | `false` |
215
236
  | `interruptOnNew` | Whether new replies interrupt the current read in auto-read mode (off = skip new replies while reading to avoid overlap) | `true` |
216
237
  | `voiceRegistryUrl` | Remote voice-market manifest URL (defaults to the online audition site; empty = bundled offline only) | site URL |
217
- | `provider` | `gsv` \| `edge` (assigned at init; switch in the settings panel) | see "TTS Mode" |
238
+ | `provider` | `gsv` \| `edge` \| `deepseek` (switch in the settings panel) | see "TTS Mode" |
218
239
  | `schemaVersion` | Config schema version (migration guard marker) | `1` |
219
240
  | `quotaDaily` | Daily quota for cloud simple mode (`null` = unlimited; guidance only) | `null` |
220
241
  | `voices` | Voice preset list | empty |
@@ -256,6 +277,7 @@ Config is stored in the active profile's config layer (the `dsh-gsv-tts:` entry
256
277
  - Config schema: `@deepseek-ai/schemastery` (volatile fields with in-place live updates)
257
278
  - Settings panel: host `settings` service (`describe`/`update`) + client `configForms` service + `settings.section` slots
258
279
  - Cloud provider: `edge-tts-universal` (Microsoft web voices, MP3 stream)
280
+ - Official provider: DeepSeek TTS (`/v1/tools/tts`, WAV), credentials from the Harness `credentials` service
259
281
  - Local engine: GSV-TTS-Lite 0.4.7
260
282
  - Languages: TypeScript (host) / hand-written client bundle (browser) / Python (streaming API)
261
283
 
@@ -280,6 +302,8 @@ Full release history: [CHANGELOG_EN.md](CHANGELOG_EN.md).
280
302
  - Playback is a clickable markdown link; inline `<audio>` playback needs a client extension (planned)
281
303
  - Generated audio lives in the system temp dir (`%TEMP%/dsh-gsv-tts`), purged on startup, capped at 200 files per session
282
304
  - Edge cloud mode depends on network; when Microsoft rate-limits, it may be unavailable (already has a downgrade guide)
305
+ - Official Voices bill per character (~CNY 0.3 per 1000 Chinese characters) and support neither rate control nor cloning; auto-read keeps generating cost
306
+ - Official Voices need `DEEPSEEK_API_KEY` saved in the Harness (or the same-named env var); account-only sign-in prompts for a key
283
307
  - `tts_setup_engine` shells out to pip/git; those tools must be available
284
308
  - Empty `promptText` relies on the engine's ASR capability (capability-probed); synthesis fails with a clear error when unsupported
285
309
 
Binary file
package/docs/voices.json CHANGED
@@ -1,66 +1,66 @@
1
- {
2
- "schema": 1,
3
- "version": "1.0.5",
4
- "trusted": true,
5
- "voices": [
6
- {
7
- "id": "cn-changhenge-female",
8
- "name": "中文女声·长恨歌",
9
- "author": "用户提供 (女声无BGM朗读《长恨歌》)",
10
- "license": "用户提供素材 — 分发前需确认授权",
11
- "speaker": "https://raw.githubusercontent.com/TaoruiLiu19/dsh-gsv/master/docs/voices/cn-changhenge-female.mp3",
12
- "prompt": "https://raw.githubusercontent.com/TaoruiLiu19/dsh-gsv/master/docs/voices/cn-changhenge-female.mp3",
13
- "promptText": "汉皇重色思倾国,御宇多年求不得。杨家有女初长成,养在深闺人未识。",
14
- "sizeBytes": 644223,
15
- "sha256": {
16
- "speaker": "1586061f343434df9ffd7aa48d99f47c9ceac53cca8d3e2b805bce7d23df063d",
17
- "prompt": "1586061f343434df9ffd7aa48d99f47c9ceac53cca8d3e2b805bce7d23df063d"
18
- }
19
- },
20
- {
21
- "id": "en-hebang",
22
- "name": "英语听力男声 (HeBang)",
23
- "author": "用户提供 (高考英语听力试音)",
24
- "license": "高考英语听力试音音频 — 分发前需确认授权",
25
- "speaker": "https://raw.githubusercontent.com/TaoruiLiu19/dsh-gsv/master/docs/voices/en-hebang.mp3",
26
- "prompt": "https://raw.githubusercontent.com/TaoruiLiu19/dsh-gsv/master/docs/voices/en-hebang.mp3",
27
- "promptText": "Yes. Every day except Thursday we have a language evening. People can come and practice their languages—you know, over a drink or something. We have different languages on different evenings. Monday—Spanish; Tuesday—Italian; Wednesday—German; and Friday—French.",
28
- "sizeBytes": 740156,
29
- "sha256": {
30
- "speaker": "cd962372d586f48a04c4169f2724d114fe07d962fea0819a0e3a0badd678a5c6",
31
- "prompt": "cd962372d586f48a04c4169f2724d114fe07d962fea0819a0e3a0badd678a5c6"
32
- }
33
- },
34
- {
35
- "id": "cn-yujie",
36
- "name": "中文女声·御姐音",
37
- "author": "用户提供 (御姐音叫起床)",
38
- "license": "用户提供素材 — 分发前需确认授权",
39
- "speaker": "https://raw.githubusercontent.com/TaoruiLiu19/gsv-market/main/voices/cn-yujie.mp3",
40
- "prompt": "https://raw.githubusercontent.com/TaoruiLiu19/gsv-market/main/voices/cn-yujie.mp3",
41
- "promptText": "早上好呀,宝宝。起床喽,乖乖起床喽。别赖床了。等会要迟到了。小懒猪,起来了。再不起来就打你屁屁喽。",
42
- "sizeBytes": 396898,
43
- "sha256": {
44
- "speaker": "daccd476763a6485be880ac6fb9119e77b4320a71db3dcee1f218a85cae27c24",
45
- "prompt": "daccd476763a6485be880ac6fb9119e77b4320a71db3dcee1f218a85cae27c24"
46
- }
47
- },
48
- {
49
- "id": "voice-5cadda94",
50
- "name": "绘梨衣",
51
- "author": "Sakura",
52
- "license": "作者明确授权分发",
53
- "speaker": "https://taoruiliu19.github.io/gsv-market/voices/voice-5cadda94.mp3",
54
- "prompt": "https://taoruiliu19.github.io/gsv-market/voices/voice-5cadda94.mp3",
55
- "promptText": "我们都是小怪兽,有一天会被正义的奥特曼杀死。我们都是小怪兽,有一天会被正义的奥特曼杀死。\\n今天能不能出去玩,知道了,我该睡觉了。晚安,过会儿我就要回家了,可以再陪我玩一会儿吗?能带我出去玩吗?迪士尼就好",
56
- "sizeBytes": 240620,
57
- "sha256": {
58
- "speaker": "5cadda94f93acb192fdfc06780a7e3b4135bc6654799e4482b6731f7fb88ba71",
59
- "prompt": "5cadda94f93acb192fdfc06780a7e3b4135bc6654799e4482b6731f7fb88ba71"
60
- },
61
- "tags": [],
62
- "language": "zh-CN",
63
- "reviewed": true
64
- }
65
- ]
66
- }
1
+ {
2
+ "schema": 1,
3
+ "version": "1.0.5",
4
+ "trusted": true,
5
+ "voices": [
6
+ {
7
+ "id": "cn-changhenge-female",
8
+ "name": "中文女声·长恨歌",
9
+ "author": "用户提供 (女声无BGM朗读《长恨歌》)",
10
+ "license": "用户提供素材 — 分发前需确认授权",
11
+ "speaker": "https://raw.githubusercontent.com/TaoruiLiu19/dsh-gsv/master/docs/voices/cn-changhenge-female.mp3",
12
+ "prompt": "https://raw.githubusercontent.com/TaoruiLiu19/dsh-gsv/master/docs/voices/cn-changhenge-female.mp3",
13
+ "promptText": "汉皇重色思倾国,御宇多年求不得。杨家有女初长成,养在深闺人未识。",
14
+ "sizeBytes": 644223,
15
+ "sha256": {
16
+ "speaker": "1586061f343434df9ffd7aa48d99f47c9ceac53cca8d3e2b805bce7d23df063d",
17
+ "prompt": "1586061f343434df9ffd7aa48d99f47c9ceac53cca8d3e2b805bce7d23df063d"
18
+ }
19
+ },
20
+ {
21
+ "id": "en-hebang",
22
+ "name": "英语听力男声 (HeBang)",
23
+ "author": "用户提供 (高考英语听力试音)",
24
+ "license": "高考英语听力试音音频 — 分发前需确认授权",
25
+ "speaker": "https://raw.githubusercontent.com/TaoruiLiu19/dsh-gsv/master/docs/voices/en-hebang.mp3",
26
+ "prompt": "https://raw.githubusercontent.com/TaoruiLiu19/dsh-gsv/master/docs/voices/en-hebang.mp3",
27
+ "promptText": "Yes. Every day except Thursday we have a language evening. People can come and practice their languages—you know, over a drink or something. We have different languages on different evenings. Monday—Spanish; Tuesday—Italian; Wednesday—German; and Friday—French.",
28
+ "sizeBytes": 740156,
29
+ "sha256": {
30
+ "speaker": "cd962372d586f48a04c4169f2724d114fe07d962fea0819a0e3a0badd678a5c6",
31
+ "prompt": "cd962372d586f48a04c4169f2724d114fe07d962fea0819a0e3a0badd678a5c6"
32
+ }
33
+ },
34
+ {
35
+ "id": "cn-yujie",
36
+ "name": "中文女声·御姐音",
37
+ "author": "用户提供 (御姐音叫起床)",
38
+ "license": "用户提供素材 — 分发前需确认授权",
39
+ "speaker": "https://taoruiliu19.github.io/gsv-market/voices/cn-yujie.mp3",
40
+ "prompt": "https://taoruiliu19.github.io/gsv-market/voices/cn-yujie.mp3",
41
+ "promptText": "早上好呀,宝宝。起床喽,乖乖起床喽。别赖床了。等会要迟到了。小懒猪,起来了。再不起来就打你屁屁喽。",
42
+ "sizeBytes": 396898,
43
+ "sha256": {
44
+ "speaker": "daccd476763a6485be880ac6fb9119e77b4320a71db3dcee1f218a85cae27c24",
45
+ "prompt": "daccd476763a6485be880ac6fb9119e77b4320a71db3dcee1f218a85cae27c24"
46
+ }
47
+ },
48
+ {
49
+ "id": "voice-5cadda94",
50
+ "name": "绘梨衣",
51
+ "author": "Sakura",
52
+ "license": "作者明确授权分发",
53
+ "speaker": "https://taoruiliu19.github.io/gsv-market/voices/voice-5cadda94.mp3",
54
+ "prompt": "https://taoruiliu19.github.io/gsv-market/voices/voice-5cadda94.mp3",
55
+ "promptText": "我们都是小怪兽,有一天会被正义的奥特曼杀死。我们都是小怪兽,有一天会被正义的奥特曼杀死。\\n今天能不能出去玩,知道了,我该睡觉了。晚安,过会儿我就要回家了,可以再陪我玩一会儿吗?能带我出去玩吗?迪士尼就好",
56
+ "sizeBytes": 240620,
57
+ "sha256": {
58
+ "speaker": "5cadda94f93acb192fdfc06780a7e3b4135bc6654799e4482b6731f7fb88ba71",
59
+ "prompt": "5cadda94f93acb192fdfc06780a7e3b4135bc6654799e4482b6731f7fb88ba71"
60
+ },
61
+ "tags": [],
62
+ "language": "zh-CN",
63
+ "reviewed": true
64
+ }
65
+ ]
66
+ }