dsh-voice 0.7.0 → 0.8.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 +9 -0
- package/README.en.md +18 -14
- package/README.md +18 -14
- package/docs/USAGE.en.md +58 -23
- package/docs/USAGE.md +57 -22
- package/lib/config.d.ts +15 -0
- package/lib/config.js +70 -0
- package/lib/edge-tts.d.ts +15 -0
- package/lib/edge-tts.js +133 -0
- package/lib/host-config.js +13 -0
- package/lib/openai-tts.d.ts +7 -0
- package/lib/openai-tts.js +22 -2
- package/lib/tools.d.ts +4 -1
- package/lib/tools.js +362 -58
- package/lib/tts-text.d.ts +5 -5
- package/lib/tts-text.js +60 -0
- package/lib/update-client.js +1 -1
- package/lib/voices.d.ts +18 -3
- package/lib/voices.js +132 -6
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +1 -1
- package/skills/voice-workflow/SKILL.md +37 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# 更新记录
|
|
2
2
|
|
|
3
|
+
## 0.8.0 (2026-11-18)
|
|
4
|
+
|
|
5
|
+
- 全量音色发现与内置目录扩容(Layer 1–2):`voice_list` 支持 `online: true` 联网拉取并缓存微软 Edge 300+ 实时音色目录(24 小时内存缓存,断网自动回退);内置音色由 29 个扩充至 45 个,覆盖童声(晓双/晓悠)、少年动漫(云夏)、纪录片/成熟(云泽/晓秋)、老年(晓睿)、激昂解说(云皓)及粤语/台湾腔/河南话/山东话等方言,并附带 `tags` 标签筛选。
|
|
6
|
+
- Full live voice discovery & catalog expansion (Layers 1–2): `voice_list` adds `online: true` to fetch and cache Microsoft Edge's 300+ live neural voice catalog for 24h (with automatic offline fallback); built-in `VOICES` expands from 29 to 45 voices covering child, teen/anime, mature/documentary, elder, expressive commercial, and regional Chinese dialects with tag filtering.
|
|
7
|
+
- 10 组开箱即用角色人设(Layer 2–4):新增 `VOICE_PERSONAS` 与 `persona` 参数(如 `late-night-radio`、`documentary-narrator`、`anime-boy`、`bedtime-story`、`bilingual-tech-female` 等),可直接用于 `voice_tts`、`segments[]` 分段播客及 `voice_preview` 试听对比。
|
|
8
|
+
- 10 ready-made voice personas (Layers 2–4): introduce `VOICE_PERSONAS` and the `persona` parameter (e.g., `late-night-radio`, `documentary-narrator`, `anime-boy`, `bedtime-story`, `bilingual-tech-female`) across `voice_tts`, multi-speaker `segments[]`, and `voice_preview`.
|
|
9
|
+
- 情绪演技指令、零样本声音克隆与自定义别名(Layer 3–4):新增 `instructions` 自然语言语气控制(自动映射 SiliconFlow `CosyVoice2-0.5B` `<|endofprompt|>` 前缀及 `[laughter]`/`[breath]` 副语言标记,以及 OpenAI `gpt-4o-mini-tts` `instructions`);新增工作区边界受控的 `referenceAudio` + `referenceText` 零样本克隆与可热更新的 `customVoices` 自定义别名设置;新增 `normalizeLoudness: true` 调用本机 FFmpeg 执行 `-16 LUFS` 播客响度均衡。
|
|
10
|
+
- Emotion acting, zero-shot cloning & custom aliases (Layers 3–4): add natural-language `instructions` (mapped to `<|endofprompt|>` with `[laughter]`/`[breath]` on SiliconFlow `CosyVoice2-0.5B`, or `instructions` on `gpt-4o-mini-tts`), workspace-bounded `referenceAudio` + `referenceText` zero-shot voice cloning, live-reloaded `customVoices` aliases in DSH Settings, and optional `-16 LUFS` podcast loudness mastering via `normalizeLoudness: true`.
|
|
11
|
+
|
|
3
12
|
## 0.7.0 (2026-11-18)
|
|
4
13
|
|
|
5
14
|
- 稳定性与协议加固(P0):严格校验 Edge TTS `Path:audio` 音频帧头与 `turn.end` 截断保护;HTTP 403 自动读取响应 `Date` 校准时钟偏差;剔除 XML 1.0 非法控制字符并转义 SSML 属性;扩展方言、多语种及 HD 音色校验与筛选;支持配置 `timeoutMs` 热更新读取与动态 `isConcurrencySafe`;`voice_health` 新增 `ttsReady`/`sttReady`、`scope` 影响面、韵律参数检查及本机免密钥 Whisper 探测。
|
package/README.en.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Turn text into natural speech and recordings into clean transcripts.**
|
|
6
6
|
|
|
7
|
-
Voice plugin for DeepSeek Harness (`>=0.2.2-rc.3`): provides zero-key Edge neural text-to-speech (
|
|
7
|
+
Voice plugin for DeepSeek Harness (`>=0.2.2-rc.3`): provides zero-key Edge neural text-to-speech (with 300+ live online voices, 45+ all-age/dialect built-ins, and 10 ready-made personas) alongside OpenAI/SiliconFlow/custom engines (supporting emotion/acting instructions, Kokoro voice blending, and 5–10s zero-shot voice cloning), direct file synthesis with Markdown cleanup, multi-speaker podcasts with `-16 LUFS` loudness mastering, synchronized `.srt`/`.vtt` subtitles, interactive browser previews, and Groq/OpenAI/SiliconFlow/local Whisper speech-to-text (STT) strictly scoped to your session workspace.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/dsh-voice) [](https://www.npmjs.com/package/dsh-voice) [](https://www.npmjs.com/package/dsh-voice)
|
|
10
10
|
|
|
@@ -19,10 +19,10 @@ Voice plugin for DeepSeek Harness (`>=0.2.2-rc.3`): provides zero-key Edge neura
|
|
|
19
19
|
|
|
20
20
|
## Highlights
|
|
21
21
|
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
22
|
+
- **300+ Live Edge Voices, All-Age/Dialect Built-ins & 10 Personas**: `voice_list({ online: true })` fetches and caches Microsoft's live 300+ neural voice catalog for 24h, falling back automatically offline to 45+ curated built-ins spanning child (`Xiaoshuang`/`Xiaoyou`), teen/anime (`Yunxia`), mature/documentary (`Yunze`/`Xiaoqiu`), elder (`Xiaorui`), passionate (`Yunhao`), and dialects (Northeast, Shaanxi, Sichuan, Henan, Shandong, Cantonese M/F, Taiwanese M/F). Ten built-in `persona` recipes (`late-night-radio`, `documentary-narrator`, `anime-boy`, etc.) work directly in `voice_tts`, `segments[]`, and `voice_preview`.
|
|
23
|
+
- **Emotion Acting, Voice Blending & Zero-Shot Cloning**: Pass natural-language acting prompts via `instructions` (mapped automatically to `<|endofprompt|>` with `[laughter]` / `[breath]` support on SiliconFlow `CosyVoice2-0.5B`, and sent natively to OpenAI `gpt-4o-mini-tts`), plus Kokoro voice-blending expressions (`zf_xiaobei*0.6+zf_xiaoni*0.4`) on custom endpoints. Clone any voice from a 5–10s workspace audio clip (`referenceAudio` + `referenceText` on `siliconflow`/`custom`) or save live-reloaded aliases in Settings `customVoices`.
|
|
24
|
+
- **Long-form File Synthesis, Podcasts, Loudness Mastering & Subtitles**: Read workspace `.md`/`.txt` files via `inputFile` with automatic Markdown cleanup and sentence-boundary chunking up to 100k chars; compose multi-speaker `segments` with `pauseMs` silences and optional `-16 LUFS` broadcast mastering (`normalizeLoudness: true` via local `ffmpeg`); export synchronized `.srt`/`.vtt` subtitles alongside TTS or STT outputs.
|
|
25
|
+
- **Interactive Auditions, Oversize Audio & Proxy Support**: `voice_preview` auditions raw voice IDs, `persona` names, and `customVoices` aliases into `voice_previews/index.html` with speed controls and one-click ID copy; `voice_stt` supports `groq`, `openai`, `siliconflow`, and keyless loopback `custom` Whisper with `autoCompress: true` for >25 MB audio; native `http://`, `https://`, `socks5://`, `socks5h://` proxy support applies live on save.
|
|
26
26
|
|
|
27
27
|
## Install
|
|
28
28
|
|
|
@@ -32,21 +32,23 @@ Open **Plugins** in the DSH desktop app and install `dsh-voice`, or use the CLI:
|
|
|
32
32
|
dsh plugin --profile desktop add dsh-voice
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
For the web profile, replace `desktop` with `web`. Restart DSH once after installing. Requires DSH `>=0.2.2-rc.3`. The plugin bundles the `voice-workflow` skill so your assistant automatically follows best practices for
|
|
35
|
+
For the web profile, replace `desktop` with `web`. Restart DSH once after installing. Requires DSH `>=0.2.2-rc.3`. The plugin bundles the `voice-workflow` skill so your assistant automatically follows best practices for voice discovery, personas, cloning, podcasts, subtitles, and transcription.
|
|
36
36
|
|
|
37
37
|
<a id="start-using-it"></a>
|
|
38
38
|
## Get Started in 3 Steps
|
|
39
39
|
|
|
40
|
-
1. **
|
|
41
|
-
2. **
|
|
42
|
-
3. **Preview, synthesize, or transcribe inside your workspace**: Keep
|
|
40
|
+
1. **TTS and voice personas work out of the box (zero API keys)**: Open a DSH session in your workspace to discover 300+ online Edge voices, use 10 built-in `persona` presets, audition samples, narrate long Markdown files, produce multi-speaker podcasts, and export `.srt`/`.vtt` subtitles immediately.
|
|
41
|
+
2. **Optional TTS engines (acting/cloning) or ASR keys (loopback Whisper is keyless)**: Open **DSH Settings → Plugins → Voice (`dsh-voice`)** — switch `ttsEngine` to `siliconflow`, `openai`, or `custom` for emotion `instructions` or `referenceAudio` cloning (and optionally save reusable `customVoices` aliases, live on save). For transcription, pick `asrEngine` (`groq`, `openai`, `siliconflow`, or `custom`) and add `asrApiKey` (loopback `127.0.0.1`/`localhost` needs no key).
|
|
42
|
+
3. **Preview, synthesize, or transcribe inside your workspace**: Keep scripts, reference clips, and recordings inside your session workspace; generated MP3s, `.txt` transcripts, `.srt`/`.vtt` subtitles, and preview pages stay safely inside the workspace and auto-number instead of overwriting existing files.
|
|
43
43
|
|
|
44
44
|
## Copy-Ready Prompts for Everyday Work
|
|
45
45
|
|
|
46
|
-
- **
|
|
47
|
-
>
|
|
48
|
-
- **Turn a Markdown report into a two-host podcast with subtitles**
|
|
49
|
-
> Read `weekly-report.md` in this workspace and turn it into a two-host dialogue
|
|
46
|
+
- **Discover online voices & personas and audition in the browser**
|
|
47
|
+
> Fetch online voices tagged `podcast` and generate previews in `voice_previews/index.html` comparing them with `late-night-radio` and `bilingual-tech-female` so I can pick one.
|
|
48
|
+
- **Turn a Markdown report into a balanced two-host podcast with subtitles**
|
|
49
|
+
> Read `weekly-report.md` in this workspace and turn it into a two-host dialogue using `podcast-host-female` and `podcast-host-male` with `normalizeLoudness` enabled, saving `podcast.mp3` and `podcast.srt`.
|
|
50
|
+
- **Zero-shot clone or emotion-directed voiceover (SiliconFlow / custom engine)**
|
|
51
|
+
> Clone the voice from `sample_ref.wav` (transcript: "Hello, I am Alex, nice to meet you") in this workspace and read this welcome script with a warm, cheerful tone, saving `welcome.mp3`.
|
|
50
52
|
- **Transcribe a large meeting recording with subtitles & action items**
|
|
51
53
|
> Transcribe `meeting.m4a` in this workspace (auto-compress if over 25 MB), save `meeting.txt` and `meeting.srt`, and list the action items.
|
|
52
54
|
|
|
@@ -55,7 +57,9 @@ For the web profile, replace `desktop` with `web`. Restart DSH once after instal
|
|
|
55
57
|
| Symptom | Likely Cause | Fix |
|
|
56
58
|
| :--- | :--- | :--- |
|
|
57
59
|
| Health check says `asrApiKey` is missing, but you only want TTS | ASR key is only needed for audio-to-text transcription | **Keep using TTS directly** — health check reports `ttsReady` / `sttReady` separately and supports `scope: "tts"` |
|
|
58
|
-
|
|
|
60
|
+
| `referenceAudio` fails saying cloning engine is required | Default `edge` engine does not support zero-shot reference cloning | Switch `ttsEngine` to `siliconflow` or `custom` in **DSH Settings → Plugins → Voice** (applies live) |
|
|
61
|
+
| `normalizeLoudness` fails saying `ffmpeg` is missing | `-16 LUFS` broadcast loudness mastering uses local `ffmpeg` | Install `ffmpeg` locally (or pre-process with `dsh-ffmpeg`), or omit `normalizeLoudness` |
|
|
62
|
+
| "Must stay inside the session workspace" error | Script, recording, reference clip, or output resolves outside workspace | Copy the file into the current DSH workspace folder first |
|
|
59
63
|
| Network / connection error | Corporate firewall or proxy required to reach Edge TTS / ASR | Set `proxyUrl` (`http://`, `https://`, `socks5://`, or `socks5h://`) in **DSH Settings → Plugins → Voice** (applies live) |
|
|
60
64
|
| Audio exceeds 25 MB limit | Standard Whisper/ASR upload limit is 25 MB | Ask the assistant to enable `autoCompress: true` (uses local `ffmpeg`) or pre-process with `dsh-ffmpeg` |
|
|
61
65
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**把文字变成自然人声,把会议录音转成干净文字。**
|
|
6
6
|
|
|
7
|
-
DeepSeek Harness(`>=0.2.2-rc.3`)语音插件:内置零密钥 Edge
|
|
7
|
+
DeepSeek Harness(`>=0.2.2-rc.3`)语音插件:内置零密钥 Edge 神经网络语音合成(支持 300+ 在线音色发现、45+ 全年龄与方言精选、10 大内置音色人设)与 OpenAI / SiliconFlow / 自定义备用引擎(支持情绪演技指令、Kokoro 混音与 5–10 秒零样本声音克隆),支持长文直读与 Markdown 清理、多角色播客拼接与 `-16 LUFS` 响度均衡、同步 `.srt` / `.vtt` 字幕导出、浏览器交互式试听页,以及 Groq / OpenAI / SiliconFlow / 本地 Whisper 语音转文字(STT),并严格将读写限制在当前会话工作区内。
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/dsh-voice) [](https://www.npmjs.com/package/dsh-voice) [](https://www.npmjs.com/package/dsh-voice)
|
|
10
10
|
|
|
@@ -19,10 +19,10 @@ DeepSeek Harness(`>=0.2.2-rc.3`)语音插件:内置零密钥 Edge 神经
|
|
|
19
19
|
|
|
20
20
|
## 核心亮点
|
|
21
21
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
22
|
+
- **300+ 在线 Edge 音色、全年龄/方言与 10 大内置人设**:`voice_list({ online: true })` 动态拉取并 24 小时缓存微软全量 300+ 神经音色,断网自动回退至 45+ 精选内置音色(覆盖童声 `Xiaoshuang`/`Xiaoyou`、少年动漫 `Yunxia`、纪录片/成熟 `Yunze`/`Xiaoqiu`、老年 `Xiaorui`、激昂 `Yunhao` 及东北/陕西/四川/河南/山东/粤语男女/台湾腔男女);内置 `late-night-radio`、`documentary-narrator`、`anime-boy` 等 10 种开箱即用 `persona`,可在 `voice_tts`、`segments[]` 与 `voice_preview` 中直接调用。
|
|
23
|
+
- **情绪演技指令、Kokoro 混音与零样本克隆**:通过 `instructions` 传入自然语言情绪与表演提示(SiliconFlow `CosyVoice2-0.5B` 自动映射 `<|endofprompt|>` 并支持 `[laughter]` / `[breath]` 副语言标记,OpenAI `gpt-4o-mini-tts` 原生透传 `instructions`),自定义端点支持 Kokoro 混音表达式(`zf_xiaobei*0.6+zf_xiaoni*0.4`);搭配 `referenceAudio` + `referenceText`(`siliconflow` / `custom` 引擎)可用 5–10 秒工作区音频零样本克隆,或在 DSH 设置 `customVoices` 中保存热更新复用别名。
|
|
24
|
+
- **长文直读、多角色播客、响度均衡与零成本字幕**:`inputFile` 直读工作区 `.md` / `.txt` 并自动清理 Markdown(最高 10 万字自动按句分片拼接);`segments` 编排多主持人对话与停顿(`pauseMs`),支持 `normalizeLoudness: true`(本机 `ffmpeg` `-16 LUFS` 广电级响度均衡);零额外开销导出 `.srt` / `.vtt` 字幕(TTS 与 STT 均支持)。
|
|
25
|
+
- **浏览器试听页、大文件转写与代理**:`voice_preview` 支持按音色 ID、内置 `persona` 与 `customVoices` 别名批量试听并生成 `voice_previews/index.html`(倍速试听与一键复制);`voice_stt` 支持 `groq` / `openai` / `siliconflow` / `custom`(本地回环免密)及 `autoCompress`(>25MB 自动压缩切片);代理原生支持 `http://`、`https://`、`socks5://` 与 `socks5h://`(保存即生效)。
|
|
26
26
|
|
|
27
27
|
## 安装
|
|
28
28
|
|
|
@@ -32,21 +32,23 @@ DeepSeek Harness(`>=0.2.2-rc.3`)语音插件:内置零密钥 Edge 神经
|
|
|
32
32
|
dsh plugin --profile desktop add dsh-voice
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
网页版把 `desktop` 改为 `web`;安装后重启一次 DSH。宿主要求 `>=0.2.2-rc.3`。插件附带 `voice-workflow`
|
|
35
|
+
网页版把 `desktop` 改为 `web`;安装后重启一次 DSH。宿主要求 `>=0.2.2-rc.3`。插件附带 `voice-workflow` 技能包,会在语音合成、人设配音、声音克隆、播客与转写任务中自动指引助手采用最佳实践。
|
|
36
36
|
|
|
37
37
|
<a id="开始使用"></a>
|
|
38
38
|
## 最快 3 步用起来
|
|
39
39
|
|
|
40
|
-
1.
|
|
41
|
-
2.
|
|
42
|
-
3. **试听选声 →
|
|
40
|
+
1. **文字转语音与人设配音开箱即用(零 API 密钥)**:装好插件后无需填任何密钥,即可联网发现 300+ Edge 音色、使用 10 种内置 `persona`、在网页试听页对比、直读 Markdown 长文、合成多角色播客并导出 `.srt` / `.vtt` 字幕。
|
|
41
|
+
2. **按需配置备用 TTS(情绪/克隆)或 ASR 密钥(本地回环免密)**:打开 DSH「**设置 → 插件 → 语音(dsh-voice)**」:如需情绪指令或零样本声音克隆,可切换 `ttsEngine` 为 `siliconflow` / `openai` / `custom`(也可在 `customVoices` 保存常用角色别名,保存即生效);如需转写录音,选择 `asrEngine`(`groq` / `openai` / `siliconflow` / `custom`)并填入 `asrApiKey`(本地 `127.0.0.1` / `localhost` Whisper 免密)。
|
|
42
|
+
3. **试听选声 → 合成或转写交付**:把待转写录音、参考克隆音频或文稿放到当前会话工作区,生成的 MP3、`.txt` 纪要、`.srt` / `.vtt` 字幕与试听页面都会安全落在工作区,默认同名自动编号不误盖。
|
|
43
43
|
|
|
44
44
|
## 平时怎么对助手说(可直接复制的自然语言示例)
|
|
45
45
|
|
|
46
|
-
-
|
|
47
|
-
>
|
|
48
|
-
- **直接把 Markdown 长文变成双人播客 + 字幕**
|
|
49
|
-
> 直接读取工作区里的 `weekly-report.md
|
|
46
|
+
- **联网发现音色/人设并在浏览器试听页里对比**
|
|
47
|
+
> 联网查一下带 `podcast` 标签的中文和英文音色,连同 `late-night-radio`、`bilingual-tech-female` 人设一起生成短试听,用 `voice_previews/index.html` 让我挑选。
|
|
48
|
+
- **直接把 Markdown 长文变成双人播客 + 响度均衡 + 字幕**
|
|
49
|
+
> 直接读取工作区里的 `weekly-report.md`,用 `podcast-host-female` 和 `podcast-host-male` 两个人设编排成双人对话播客,开启响度均衡,输出 `podcast.mp3` 和 `podcast.srt`。
|
|
50
|
+
- **用工作区 5–10 秒参考音频做零样本克隆或情绪配音(SiliconFlow / 自定义引擎)**
|
|
51
|
+
> 用工作区里的 `sample_ref.wav`(台词是「你好,我是小智,很高兴认识大家」)作为参考声音,用轻快带笑意的语气朗读这段欢迎词,导出 `welcome.mp3`。
|
|
50
52
|
- **把大体积会议录音转成文字、字幕与纪要**
|
|
51
53
|
> 把当前目录里的 `meeting.m4a` 转写成中文(如果超过 25MB 就自动压缩分段),同时输出 `meeting.txt` 和 `meeting.srt`,再提炼待办事项清单。
|
|
52
54
|
|
|
@@ -55,7 +57,9 @@ dsh plugin --profile desktop add dsh-voice
|
|
|
55
57
|
| 遇到的现象 | 10 秒定位原因 | 怎么修 |
|
|
56
58
|
| :--- | :--- | :--- |
|
|
57
59
|
| 自检提示「缺 ASR 密钥」但只想做朗读配音 | ASR 密钥仅录音转文字需要,不影响朗读 | **直接正常合成语音即可**(自检可按 `tts` 范围单独查看 `ttsReady`) |
|
|
58
|
-
|
|
|
60
|
+
| 传入 `referenceAudio` 提示引擎不支持克隆 | 默认 `edge` 引擎不支持零样本参考音频克隆 | 在 DSH「设置 → 插件 → 语音」将 `ttsEngine` 切为 `siliconflow` 或 `custom`(保存即生效) |
|
|
61
|
+
| 开启 `normalizeLoudness` 报错缺工具 | `-16 LUFS` 响度均衡需要本机 `ffmpeg` | 本机安装 `ffmpeg`(或先用 `dsh-ffmpeg` 处理),未安装时先不开启该开关 |
|
|
62
|
+
| 提示「必须位于会话工作区内」 | 文稿、录音、参考音频或输出路径指到了工作区外面 | 先把文件复制进当前会话工作区文件夹再让助手处理 |
|
|
59
63
|
| 合成或转写报网络连接失败 | 受限网络无法直连在线语音 / ASR 服务 | 在 DSH「设置 → 插件 → 语音」填入本地代理 `proxyUrl`(支持 `http://` / `https://` / `socks5://` / `socks5h://`,保存即生效) |
|
|
60
64
|
| 音频超过 25MB 无法转写 | 在线 ASR 接口单文件体积上限为 25MB | 让助手开启 `autoCompress: true`(需本机有 `ffmpeg`)自动压缩/切片转写,或先用 `dsh-ffmpeg` 处理 |
|
|
61
65
|
|
package/docs/USAGE.en.md
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
## Get Started in 3 Steps
|
|
6
6
|
|
|
7
|
-
### Step 1: Know What Works Out of the Box vs. Optional TTS / ASR Setup
|
|
7
|
+
### Step 1: Know What Works Out of the Box vs. Optional TTS / ASR / Alias Setup
|
|
8
8
|
|
|
9
|
-
- **Text-to-speech (`voice_tts`, `voice_list`, `voice_preview`) works with zero config**: Uses Edge neural voices by default with zero API keys —
|
|
9
|
+
- **Text-to-speech (`voice_tts`, `voice_list`, `voice_preview`) works with zero config**: Uses Edge neural voices by default with zero API keys — discover 300+ live online Edge voices or 45+ all-age/dialect built-ins, apply 10 ready-made `persona` presets, generate an interactive browser audition page, narrate long workspace files, compose multi-speaker podcasts, and export `.srt`/`.vtt` subtitles. Switch `ttsEngine` to `siliconflow`, `openai`, or `custom` in Settings when you need emotion `instructions`, Kokoro voice blending, or zero-shot `referenceAudio` cloning.
|
|
10
10
|
- **Speech-to-text (`voice_stt`) needs an ASR key for cloud endpoints (loopback Whisper is keyless)**:
|
|
11
11
|
- **Recommended**: Open **DSH → Settings → Plugins → Voice (`dsh-voice`)**, pick `asrEngine` (`groq` by default, `openai`, `siliconflow`, or `custom`), and paste `asrApiKey` (masked and **applied live on save without restarting**; when `custom` points to `127.0.0.1` or `localhost`, no key is required);
|
|
12
|
+
- **Custom voice aliases (`customVoices`)**: Save reusable named characters (`name`, `voice`, `persona`, `rate`, `pitch`, `instructions`, `referenceAudio`, `referenceText`) in DSH Settings `customVoices` (live-reloaded without restarting) and reference them directly in `voice_tts`, `segments[]`, and `voice_preview`;
|
|
12
13
|
- **CLI / Environment variable**: Set `DSH_VOICE_ASR_KEY` (and optionally `DSH_VOICE_TTS_KEY`) or configure `cordis.patch.yml`:
|
|
13
14
|
|
|
14
15
|
```yaml
|
|
@@ -16,40 +17,51 @@
|
|
|
16
17
|
name: 'dsh-voice'
|
|
17
18
|
config:
|
|
18
19
|
ttsEngine: edge # edge | openai | siliconflow | custom
|
|
19
|
-
ttsVoice: zh-CN-XiaoxiaoNeural # default voice (applies live)
|
|
20
|
+
ttsVoice: zh-CN-XiaoxiaoNeural # default voice ID, built-in persona, or customVoices alias (applies live)
|
|
20
21
|
ttsRate: '+0%' # default speech rate, e.g. +15% or -10%
|
|
21
22
|
ttsPitch: '+0Hz' # default pitch, e.g. +2Hz or -1Hz
|
|
22
23
|
# ttsBaseUrl: https://api.siliconflow.cn/v1 # optional for non-edge engines
|
|
23
24
|
# ttsModel: FunAudioLLM/CosyVoice2-0.5B
|
|
24
25
|
# ttsApiKey: sk-... # prefer DSH Settings or DSH_VOICE_TTS_KEY
|
|
26
|
+
# customVoices:
|
|
27
|
+
# - name: narrator-wang
|
|
28
|
+
# persona: documentary-narrator
|
|
29
|
+
# rate: '-5%'
|
|
30
|
+
# - name: kokoro-blend
|
|
31
|
+
# voice: 'zf_xiaobei*0.6+zf_xiaoni*0.4'
|
|
32
|
+
# - name: alex-clone
|
|
33
|
+
# referenceAudio: voices/alex.wav
|
|
34
|
+
# referenceText: 'Hello, this is my reference voice sample.'
|
|
25
35
|
asrEngine: groq # groq | openai | siliconflow | custom
|
|
26
36
|
asrModel: whisper-large-v3-turbo # optional; defaults to engine preset
|
|
27
37
|
# asrApiKey: gsk_... # prefer DSH Settings or DSH_VOICE_ASR_KEY (optional for loopback custom)
|
|
28
38
|
# proxyUrl: socks5://127.0.0.1:1080 # supports http://, https://, socks5://, socks5h://
|
|
29
39
|
```
|
|
30
40
|
|
|
31
|
-
### Step 2: Keep Scripts, Audio & Outputs Inside Your Session Workspace
|
|
41
|
+
### Step 2: Keep Scripts, Reference Clips, Audio & Outputs Inside Your Session Workspace
|
|
32
42
|
|
|
33
|
-
All `voice_tts` input files (`inputFile`), input audio (`audio`), and generated MP3 / `.txt` / `.srt` / `.vtt` / preview files must resolve under the active DSH session workspace (`session.header.cwd`) to protect host files. Copy outside files into the workspace first.
|
|
43
|
+
All `voice_tts` input files (`inputFile`), zero-shot cloning clips (`referenceAudio`, ≤10 MB), input audio (`audio`), and generated MP3 / `.txt` / `.srt` / `.vtt` / preview files must resolve under the active DSH session workspace (`session.header.cwd`) to protect host files. Copy outside files into the workspace first.
|
|
34
44
|
|
|
35
|
-
### Step 3:
|
|
45
|
+
### Step 3: Discover Voices/Personas, Audition, Then Synthesize or Transcribe
|
|
36
46
|
|
|
37
|
-
Unsure which voice fits best?
|
|
47
|
+
Unsure which voice fits best? Call `voice_list({ online: true, locale, gender, tag })` to fetch Microsoft's live 300+ neural voices (cached 24h in memory with automatic fallback to 45+ curated built-ins, plus the 10 built-in `persona` recipes and configured `customVoices`), then call `voice_preview` to render short samples plus an interactive `voice_previews/index.html` page. The plugin ships `skills/voice-workflow/SKILL.md` so your assistant automatically uses `inputFile`, Markdown cleanup, `persona`, `segments`, `-16 LUFS` loudness normalization, and subtitle export.
|
|
38
48
|
|
|
39
49
|
---
|
|
40
50
|
|
|
41
51
|
## Copy-Ready Prompts for Everyday Work
|
|
42
52
|
|
|
43
|
-
- **
|
|
44
|
-
>
|
|
45
|
-
- **Narrate a Markdown file directly with synchronized subtitles**
|
|
46
|
-
> Synthesize `guide.md` in this workspace using `
|
|
47
|
-
- **Create a two-host podcast MP3**
|
|
48
|
-
> Turn this release note into a two-host podcast using `
|
|
53
|
+
- **Discover online voices & personas and audition via the interactive HTML page**
|
|
54
|
+
> Run `voice_list` with `online: true` for tag `podcast`, then preview a few alongside `late-night-radio` and `anime-boy` in `voice_previews/index.html` so I can pick my favorite.
|
|
55
|
+
- **Narrate a Markdown file directly with a persona and synchronized subtitles**
|
|
56
|
+
> Synthesize `guide.md` in this workspace using `documentary-narrator` into `guide.mp3` and export `guide.srt`.
|
|
57
|
+
- **Create a loudness-balanced two-host podcast MP3**
|
|
58
|
+
> Turn this release note into a two-host podcast using `podcast-host-female` and `podcast-host-male` with `normalizeLoudness: true`, saving `episode.mp3` and `episode.srt`.
|
|
59
|
+
- **Emotion-directed acting or 5–10s zero-shot voice cloning (SiliconFlow / OpenAI / custom engine)**
|
|
60
|
+
> Use `ref.wav` (transcript: "Hello, what a great day to start!") in this workspace for zero-shot cloning with cheerful acting `instructions` and inline `[laughter]`, saving `greeting.mp3`.
|
|
49
61
|
- **Transcribe a large recording with auto-compression and subtitles**
|
|
50
62
|
> Transcribe `interview.m4a` in this workspace (enable `autoCompress` if over 25 MB; prompt hint: DeepSeek Harness, Cordis), and save `interview.txt` and `interview.srt`.
|
|
51
63
|
- **Scoped offline configuration self-check**
|
|
52
|
-
> Run a voice health check to verify `ttsReady`, `sttReady`, prosody settings, proxy, and ASR key status.
|
|
64
|
+
> Run a voice health check to verify `ttsReady`, `sttReady`, voice/persona/alias status, prosody settings, proxy, and ASR key status.
|
|
53
65
|
|
|
54
66
|
---
|
|
55
67
|
|
|
@@ -60,35 +72,58 @@ Run `voice_health` first (offline check with zero network traffic; supports `sco
|
|
|
60
72
|
| Symptom | Usual Cause | Quick Fix |
|
|
61
73
|
| :--- | :--- | :--- |
|
|
62
74
|
| Health check says `asrApiKey` is missing | `asrApiKey` and `DSH_VOICE_ASR_KEY` are both empty | Safe to ignore if you only need TTS (`ttsReady` is `true`), or pass `scope: "tts"`; for local Whisper, set `asrEngine: custom` with `127.0.0.1`/`localhost` (no key needed) |
|
|
63
|
-
|
|
|
75
|
+
| `referenceAudio` fails saying cloning engine is required | `ttsEngine` is still `edge` (Edge does not support zero-shot reference cloning) | Switch `ttsEngine` to `siliconflow` (`CosyVoice2-0.5B`) or `custom` (e.g. local GPT-SoVITS / IndexTTS) in **DSH Settings → Plugins → Voice** |
|
|
76
|
+
| `normalizeLoudness` fails saying `ffmpeg` is missing | `-16 LUFS` broadcast loudness mastering requires local `ffmpeg` | Install `ffmpeg` locally (or pre-process with `dsh-ffmpeg`), or omit `normalizeLoudness` |
|
|
77
|
+
| Invalid voice ID, rate, or pitch error | `ttsVoice` is not a valid Edge ID, built-in `persona`, or `customVoices` alias, or `ttsRate`/`ttsPitch` format is invalid | Run `voice_list` to pick a valid ID or persona, and fix `ttsVoice` / `ttsRate` / `ttsPitch` in Settings |
|
|
64
78
|
| Network error on TTS or STT | Direct connection blocked by corporate network | Enter `proxyUrl` (`http://`, `https://`, `socks5://`, or `socks5h://`) in **DSH Settings → Plugins → Voice** (applies live) |
|
|
65
|
-
| Path outside session workspace error | Script, audio, or output
|
|
79
|
+
| Path outside session workspace error | Script, reference clip, audio, or output resolves outside workspace | Copy the file into the current session workspace folder first |
|
|
66
80
|
| Audio exceeds 25 MB limit | Standard Whisper / ASR multipart cap is 25 MB | Pass `autoCompress: true` to `voice_stt` (uses local `ffmpeg` to compress/segment automatically) or pre-process with `dsh-ffmpeg` |
|
|
67
81
|
| ASR or TTS refuses a 3xx redirect | Redirects are blocked so audio/keys never leak to another host | Set `asrBaseUrl` / `ttsBaseUrl` directly to the final non-redirecting `/v1` endpoint |
|
|
68
82
|
| Existing output file was not overwritten | `overwrite: false` (default) suffixes `_1`, `_2` safely | Use the exact path returned by the tool, or enable `overwrite` in Settings |
|
|
69
83
|
|
|
70
84
|
---
|
|
71
85
|
|
|
72
|
-
## Tool &
|
|
86
|
+
## Tool & Voice Diversity Reference
|
|
73
87
|
|
|
74
88
|
### Registered Tools (All 5)
|
|
75
89
|
|
|
76
90
|
| Tool | Purpose | Key Parameters & Notes |
|
|
77
91
|
| :--- | :--- | :--- |
|
|
78
|
-
| `voice_tts` | Synthesize MP3 & subtitles from text, files, or dialogues | Supports `text`, `inputFile` (≤100k chars auto-chunked), `cleanMarkdown` (default `true` for `.md`), `segments` (≤50 turns
|
|
92
|
+
| `voice_tts` | Synthesize MP3 & subtitles from text, files, or dialogues | Supports `text`, `inputFile` (≤100k chars auto-chunked), `cleanMarkdown` (default `true` for `.md`), `segments` (≤50 turns, per-turn `voice`/`persona`/`rate`/`pitch`/`pauseMs`/`instructions`/`referenceAudio`/`referenceText`), `persona`, `instructions`, `referenceAudio` (≤10 MB), `referenceText`, `normalizeLoudness` (`-16 LUFS`), `subtitleOutput` (`.srt`/`.vtt`), `voice`, `rate`, `pitch`, `output` |
|
|
79
93
|
| `voice_stt` | Transcribe audio to text & subtitles (zero-copy upload) | `audio` required; supports `autoCompress` (uses local `ffmpeg` for >25 MB), `timestamps`, `subtitleOutput` (`.srt`/`.vtt`), `model`, `language`, `prompt`, `output`, `engine` |
|
|
80
|
-
| `voice_list` |
|
|
81
|
-
| `voice_preview` | Bounded-concurrency (≤3) batch previews + HTML page | Optional `voices` (≤8), `text` (≤200 chars), `outputDir`, `htmlIndex` (default `true`, writes `voice_previews/index.html`) |
|
|
82
|
-
| `voice_health` | Offline configuration self-check | Optional `scope` (`all`/`tts`/`stt`), reports `ttsReady` / `sttReady` across engines, voice/prosody, proxy, and keys |
|
|
94
|
+
| `voice_list` | Discover online/built-in voices, personas & custom aliases | Optional `online` (`true` fetches & caches 300+ live Microsoft Edge voices for 24h, falling back to 45+ curated built-ins), `locale`, `gender` (`Female`/`Male`), `tag` (e.g. `podcast`, `multilingual`, `dialect`, `child`, `teen`, `mature`, `elder`, `anime`, `documentary`), `includePersonas` (default `true`) |
|
|
95
|
+
| `voice_preview` | Bounded-concurrency (≤3) batch previews + HTML page | Optional `voices` (≤8; accepts raw voice IDs, built-in `persona` IDs/labels, or `customVoices` aliases), `text` (≤200 chars), `outputDir`, `htmlIndex` (default `true`, writes `voice_previews/index.html`) |
|
|
96
|
+
| `voice_health` | Offline configuration self-check | Optional `scope` (`all`/`tts`/`stt`), reports `ttsReady` / `sttReady` across engines, voice/persona/`customVoices` aliases, prosody, proxy, and keys |
|
|
97
|
+
|
|
98
|
+
### `0.8.0` 4-Layer Voice Diversity Overview
|
|
99
|
+
|
|
100
|
+
1. **300+ Live Edge Voice Discovery & 45+ All-Age/Dialect Built-ins**:
|
|
101
|
+
- `voice_list({ online: true })` fetches and caches (24h) Microsoft's live 300+ neural voice catalog, with automatic offline fallback (`source: "builtin-fallback"`) to 45+ curated voices:
|
|
102
|
+
- **Child / Cute**: `zh-CN-XiaoshuangNeural`, `zh-CN-XiaoyouNeural`
|
|
103
|
+
- **Teen / Anime**: `zh-CN-YunxiaNeural`
|
|
104
|
+
- **Mature / Documentary / Elder**: `zh-CN-YunzeNeural`, `zh-CN-XiaoqiuNeural`, `zh-CN-XiaoruiNeural`
|
|
105
|
+
- **Passionate / Drama**: `zh-CN-YunhaoNeural`, `zh-CN-YunfengNeural`, `zh-CN-XiaohanNeural`, `zh-CN-XiaomoNeural`, `zh-CN-XiaoxuanNeural`
|
|
106
|
+
- **Chinese Dialects & HK/TW**: Northeast (`zh-CN-liaoning-XiaobeiNeural`), Shaanxi (`zh-CN-shaanxi-XiaoniNeural`), Sichuan (`zh-CN-sichuan-YunxiNeural`), Henan (`zh-CN-henan-YundengNeural`), Shandong (`zh-CN-shandong-YunxiangNeural`), Cantonese M/F (`zh-HK-WanLungNeural` / `zh-HK-HiuMaanNeural`), Taiwanese M/F (`zh-TW-YunJheNeural` / `zh-TW-HsiaoChenNeural` / `zh-TW-HsiaoYuNeural`)
|
|
107
|
+
2. **10 Ready-Made Personas (`persona`)**:
|
|
108
|
+
- `late-night-radio`, `podcast-host-female`, `podcast-host-male`, `documentary-narrator`, `bedtime-story`, `anime-boy`, `energetic-anchor`, `news-briefing`, `bilingual-tech-female`, `bilingual-tech-male`.
|
|
109
|
+
3. **Emotion, Acting & Kokoro Blending (`instructions`)**:
|
|
110
|
+
- Sent natively as `instructions` on OpenAI `gpt-4o-mini-tts`;
|
|
111
|
+
- Automatically formatted as `<|endofprompt|>` prefix on SiliconFlow `FunAudioLLM/CosyVoice2-0.5B` with inline `[laughter]` / `[breath]` paralinguistics;
|
|
112
|
+
- Supports Kokoro voice-blending expressions (`zf_xiaobei*0.6+zf_xiaoni*0.4`) on custom endpoints.
|
|
113
|
+
4. **Zero-Shot Voice Cloning (`referenceAudio` + `referenceText`) & `customVoices` Aliases**:
|
|
114
|
+
- Clone any voice from a 5–10s clean workspace clip (≤10 MB) on `ttsEngine: 'siliconflow'` or `'custom'`;
|
|
115
|
+
- Save reusable named presets in DSH Settings `customVoices` (live-reloaded without restart) for `voice_tts`, `segments[]`, and `voice_preview`.
|
|
116
|
+
5. **Podcast Loudness Mastering (`normalizeLoudness: true`)**:
|
|
117
|
+
- Runs local `ffmpeg` (`loudnorm=I=-16:TP=-1.5:LRA=11`) after synthesis/concatenation for even `-16 LUFS` broadcast loudness across voices.
|
|
83
118
|
|
|
84
119
|
### Engine Presets & Workspace Guardrails
|
|
85
120
|
|
|
86
121
|
- **Engine presets**:
|
|
87
122
|
- `asrEngine`: `groq` (`whisper-large-v3-turbo`), `openai` (`whisper-1`), `siliconflow` (`FunAudioLLM/SenseVoiceSmall`), `custom` (keyless when targeting loopback `127.0.0.1` / `localhost`).
|
|
88
123
|
- `ttsEngine`: `edge` (zero-key default), `openai` (`gpt-4o-mini-tts`), `siliconflow` (`FunAudioLLM/CosyVoice2-0.5B`), `custom` (OpenAI `/audio/speech`-compatible endpoint).
|
|
89
|
-
- **Workspace confinement & symlink protection**: All reads and writes stay under `session.header.cwd`, symlinks are never written through, new files use `O_EXCL`, and `.txt`/subtitle outputs use `0600` permissions on POSIX.
|
|
124
|
+
- **Workspace confinement & symlink protection**: All reads and writes (`inputFile`, `referenceAudio`, `audio`, and all outputs) stay under `session.header.cwd`, symlinks are never written through, new files use `O_EXCL`, and `.txt`/subtitle outputs use `0600` permissions on POSIX.
|
|
90
125
|
- **Pinned endpoint & redirect block**: Requests only go to the configured endpoint, mismatched `engine` overrides are rejected, and `3xx` redirects abort immediately.
|
|
91
|
-
- **Live timeouts & instant cancellation**: `timeoutMs`
|
|
126
|
+
- **Live timeouts & instant cancellation**: `timeoutMs` and `customVoices` update dynamically on config save; `voice_tts`, `voice_preview`, `voice_list`, and `voice_stt` propagate `exec.signal` to close WebSockets and abort compression/uploads immediately on cancel.
|
|
92
127
|
|
|
93
128
|
## Install, Uninstall & Development
|
|
94
129
|
|
package/docs/USAGE.md
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
## 最快 3 步用起来
|
|
6
6
|
|
|
7
|
-
### 第 1 步:了解零配置范围与可选 TTS / ASR
|
|
7
|
+
### 第 1 步:了解零配置范围与可选 TTS / ASR / 自定义别名配置
|
|
8
8
|
|
|
9
|
-
- **文字转语音(`voice_tts` / `voice_list` / `voice_preview`)零配置即用**:默认使用 Edge 神经语音,无需任何 API
|
|
9
|
+
- **文字转语音(`voice_tts` / `voice_list` / `voice_preview`)零配置即用**:默认使用 Edge 神经语音,无需任何 API 密钥即可联网发现 300+ 实时音色或使用 45+ 全年龄/方言内置音色、调用 10 大内置 `persona` 人设、生成网页试听页、直读长文并合成 MP3 与 `.srt`/`.vtt` 字幕;如需情绪指令(`instructions`)、Kokoro 混音或零样本参考克隆(`referenceAudio`),可在设置中切换 `ttsEngine` 为 `siliconflow`、`openai` 或 `custom`。
|
|
10
10
|
- **录音转文字(`voice_stt`)按需填密钥(本地回环免密)**:
|
|
11
11
|
- **推荐方式**:打开 **DSH → 设置 → 插件 → 语音(`dsh-voice`)**,选择 `asrEngine`(默认 `groq`,可选 `openai`、`siliconflow` 或 `custom`),填入 `asrApiKey`(自动脱敏,**保存立即生效、无需重启**;当 `custom` 指向 `127.0.0.1` / `localhost` 本地 Whisper 服务时无需密钥);
|
|
12
|
+
- **自定义音色别名(`customVoices`)**:可在 DSH 设置的 `customVoices` 列表中保存命名角色(支持绑定 `voice`、`persona`、`rate`、`pitch`、`instructions`、`referenceAudio`、`referenceText`),保存即热更新生效,可直接在 `voice_tts`、`segments[]` 与 `voice_preview` 中按别名调用;
|
|
12
13
|
- **命令行 / 环境变量方式**:设置环境变量 `DSH_VOICE_ASR_KEY`(及可选 `DSH_VOICE_TTS_KEY`),或在 `cordis.patch.yml` 中配置:
|
|
13
14
|
|
|
14
15
|
```yaml
|
|
@@ -16,40 +17,51 @@
|
|
|
16
17
|
name: 'dsh-voice'
|
|
17
18
|
config:
|
|
18
19
|
ttsEngine: edge # edge | openai | siliconflow | custom
|
|
19
|
-
ttsVoice: zh-CN-XiaoxiaoNeural #
|
|
20
|
+
ttsVoice: zh-CN-XiaoxiaoNeural # 默认音色 ID、内置 persona 或 customVoices 别名(保存即生效)
|
|
20
21
|
ttsRate: '+0%' # 默认语速,如 +15% 或 -10%
|
|
21
22
|
ttsPitch: '+0Hz' # 默认音调,如 +2Hz 或 -1Hz
|
|
22
23
|
# ttsBaseUrl: https://api.siliconflow.cn/v1 # 非 edge 引擎时可自定义
|
|
23
24
|
# ttsModel: FunAudioLLM/CosyVoice2-0.5B
|
|
24
25
|
# ttsApiKey: sk-... # 推荐在 DSH 设置页填写或用 DSH_VOICE_TTS_KEY
|
|
26
|
+
# customVoices:
|
|
27
|
+
# - name: 老王
|
|
28
|
+
# persona: documentary-narrator
|
|
29
|
+
# rate: '-5%'
|
|
30
|
+
# - name: 混音女声
|
|
31
|
+
# voice: 'zf_xiaobei*0.6+zf_xiaoni*0.4'
|
|
32
|
+
# - name: 小智克隆
|
|
33
|
+
# referenceAudio: voices/xiaozhi.wav
|
|
34
|
+
# referenceText: '你好,这是我的声音参考样本。'
|
|
25
35
|
asrEngine: groq # groq | openai | siliconflow | custom
|
|
26
36
|
asrModel: whisper-large-v3-turbo # 可选;留空按引擎预设自动填入
|
|
27
37
|
# asrApiKey: gsk_... # 推荐在 DSH 设置页填写或用 DSH_VOICE_ASR_KEY(本地回环 custom 可留空)
|
|
28
38
|
# proxyUrl: socks5://127.0.0.1:1080 # 支持 http://、https://、socks5://、socks5h://
|
|
29
39
|
```
|
|
30
40
|
|
|
31
|
-
### 第 2
|
|
41
|
+
### 第 2 步:在工作区内准备文稿、参考音频或录音
|
|
32
42
|
|
|
33
|
-
为了防止路径越界读取隐私文件,所有 `voice_tts` 直读文稿(`inputFile
|
|
43
|
+
为了防止路径越界读取隐私文件,所有 `voice_tts` 直读文稿(`inputFile`)、零样本克隆参考音频(`referenceAudio`,≤10MB)、待转写音频(`audio`)以及生成的 MP3 / `.txt` / `.srt` / `.vtt` / 试听页都严格限制在**当前会话工作区**内;外部文件请先复制进工作区目录。
|
|
34
44
|
|
|
35
|
-
### 第 3
|
|
45
|
+
### 第 3 步:发现音色/人设 → 试听对比 → 合成或转写
|
|
36
46
|
|
|
37
|
-
|
|
47
|
+
不确定哪个声音合适时,先让助手调用 `voice_list({ online: true, locale, gender, tag })` 联网发现微软 300+ 神经音色(24h 缓存,断网自动回退 45+ 精选音色,并一并返回 10 大内置 `persona` 与 `customVoices` 别名),再用 `voice_preview` 生成短试听样例与交互式 `voice_previews/index.html` 浏览器试听页;插件内建 `skills/voice-workflow/SKILL.md` 工作流指南,助手会自动优先使用 `inputFile`、Markdown 清理、`persona`、`segments` 播客编排、`-16 LUFS` 响度均衡与字幕导出。
|
|
38
48
|
|
|
39
49
|
---
|
|
40
50
|
|
|
41
51
|
## 平时怎么对助手说(可直接复制的自然语言示例)
|
|
42
52
|
|
|
43
|
-
-
|
|
44
|
-
>
|
|
53
|
+
- **联网发现音色并连同内置人设生成网页试听页**
|
|
54
|
+
> 调用 `voice_list` 联网按 `podcast` 标签筛选中英文音色,挑几个连同 `late-night-radio` 和 `anime-boy` 人设一起生成短试听,打开 `voice_previews/index.html` 让我选。
|
|
45
55
|
- **直接朗读 Markdown 长文并导出同步字幕**
|
|
46
|
-
> 用 `
|
|
47
|
-
-
|
|
48
|
-
>
|
|
56
|
+
> 用 `documentary-narrator` 人设直接读取工作区 `guide.md` 合成 `guide.mp3`,同时导出 `guide.srt`。
|
|
57
|
+
- **制作响度均衡的双人对话播客 MP3**
|
|
58
|
+
> 把这篇更新整理成双人播客,女主持用 `podcast-host-female`,男主持用 `podcast-host-male`,开启 `normalizeLoudness` 响度均衡,导出 `episode.mp3` 和 `episode.srt`。
|
|
59
|
+
- **情绪演技配音或 5–10 秒零样本声音克隆(SiliconFlow / OpenAI / 自定义引擎)**
|
|
60
|
+
> 用工作区的 `ref.wav`(对应台词「今天天气真好,我们出发吧」)零样本克隆声音,加上 `[laughter]` 和轻快热情的 `instructions` 语气提示,合成 `greeting.mp3`。
|
|
49
61
|
- **大体积录音转写 + 专有名词纠偏 + 字幕导出**
|
|
50
62
|
> 把工作区里的 `interview.m4a` 转写成中文(如果超过 25MB 自动压缩分段,提示词加上:DeepSeek Harness、Cordis),存成 `interview.txt` 和 `interview.srt`。
|
|
51
63
|
- **按范围执行离线配置自检**
|
|
52
|
-
> 跑一下语音插件自检(分别看看 `ttsReady` 和 `sttReady
|
|
64
|
+
> 跑一下语音插件自检(分别看看 `ttsReady` 和 `sttReady`),检查默认音色/人设/自定义别名、语速音调格式、代理和 ASR 配置状态。
|
|
53
65
|
|
|
54
66
|
---
|
|
55
67
|
|
|
@@ -60,35 +72,58 @@
|
|
|
60
72
|
| 现象 | 常见原因 | 一步修复 |
|
|
61
73
|
| :--- | :--- | :--- |
|
|
62
74
|
| 自检提示「缺 ASR 密钥」 | 尚未填写 `asrApiKey` 且未设 `DSH_VOICE_ASR_KEY` | 若只需朗读配音可忽略(`ttsReady` 为 `true` 时 `voice_tts` 正常可用),或传 `scope: "tts"`;本地 Whisper 可设 `asrEngine: custom` 指向 `127.0.0.1` / `localhost` 免密运行 |
|
|
63
|
-
|
|
|
75
|
+
| 传入 `referenceAudio` 报错不支持克隆 | 当前 `ttsEngine` 仍为 `edge`(Edge 不支持参考音频克隆) | 在 **DSH「设置 → 插件 → 语音」**将 `ttsEngine` 切为 `siliconflow`(`CosyVoice2-0.5B`)或 `custom`(如本地 GPT-SoVITS / IndexTTS) |
|
|
76
|
+
| 开启 `normalizeLoudness` 报错缺 `ffmpeg` | `-16 LUFS` 广电响度均衡依赖本机 `ffmpeg` | 本机安装 `ffmpeg`(或先用 `dsh-ffmpeg` 处理),或暂时关闭 `normalizeLoudness` |
|
|
77
|
+
| 提示音色 ID、语速或音调不合法 | `ttsVoice` 既非合法 Edge ID 也不在内置 `persona`/`customVoices` 中,或 `ttsRate`/`ttsPitch` 格式不对 | 用 `voice_list` 查看合法 ID 与人设,在设置页修正 `ttsVoice`、`ttsRate`、`ttsPitch` |
|
|
64
78
|
| `voice_tts` 或 `voice_stt` 报网络失败 | 当前网络无法直连 Edge 朗读服务或外网 ASR 接口 | 在 **DSH「设置 → 插件 → 语音」**填写 `proxyUrl`(支持 `http://`、`https://`、`socks5://`、`socks5h://`,保存即生效) |
|
|
65
|
-
| 提示文件必须位于会话工作区内 | 传入了工作区外部路径或越界符号链接 |
|
|
79
|
+
| 提示文件必须位于会话工作区内 | 传入了工作区外部路径或越界符号链接 | 将文稿、参考音频或录音复制到当前会话工作区文件夹内再执行 |
|
|
66
80
|
| 音频超过 25MB 报超限 | OpenAI / Groq 兼容 ASR 单文件上限 25MB | 调用 `voice_stt` 时传入 `autoCompress: true`(调用本机 `ffmpeg` 自动转码压缩/分段),或先用 `dsh-ffmpeg` 处理 |
|
|
67
81
|
| ASR 返回 3xx 重定向被拦截 | 为防音频与密钥被转发到第三方主机,插件拒绝自动跟随重定向 | 将 `asrBaseUrl` 或 `ttsBaseUrl` 直接改为服务商最终无跳转的 `/v1` 地址 |
|
|
68
82
|
| 同名文件没有覆盖旧文件 | 默认 `overwrite: false` 防误删,自动追加 `_1`、`_2` 序号 | 查看工具返回的实际落盘路径,或在设置中显式开启 `overwrite` |
|
|
69
83
|
|
|
70
84
|
---
|
|
71
85
|
|
|
72
|
-
##
|
|
86
|
+
## 工具与语音多样性参考
|
|
73
87
|
|
|
74
88
|
### 注册工具清单(共 5 个)
|
|
75
89
|
|
|
76
90
|
| 工具 | 作用 | 关键参数与说明 |
|
|
77
91
|
| :--- | :--- | :--- |
|
|
78
|
-
| `voice_tts` | 文字/文稿/播客合成 MP3 与字幕 | 支持 `text`、`inputFile`(≤10 万字自动分片拼接)、`cleanMarkdown`(`.md` 默认开启)、`segments`(最多 50
|
|
92
|
+
| `voice_tts` | 文字/文稿/播客合成 MP3 与字幕 | 支持 `text`、`inputFile`(≤10 万字自动分片拼接)、`cleanMarkdown`(`.md` 默认开启)、`segments`(最多 50 段,每段独立支持 `voice`/`persona`/`rate`/`pitch`/`pauseMs`/`instructions`/`referenceAudio`/`referenceText`)、`persona`、`instructions`、`referenceAudio`(≤10MB)、`referenceText`、`normalizeLoudness`(`-16 LUFS`)、`subtitleOutput`(`.srt`/`.vtt`)、`voice`、`rate`、`pitch`、`output` |
|
|
79
93
|
| `voice_stt` | 音频转文字与字幕(零拷贝流式上传) | `audio` 必填;支持 `autoCompress`(>25MB 用本机 `ffmpeg` 自动压缩分段)、`timestamps`、`subtitleOutput`(`.srt`/`.vtt`)、`model`、`language`、`prompt`、`output`、`engine` |
|
|
80
|
-
| `voice_list` |
|
|
81
|
-
| `voice_preview` | 有界并发(≤3)批量试听并生成网页试听页 | 可选 `voices`(≤8
|
|
82
|
-
| `voice_health` | 本地配置自检(不触网) | 可选 `scope`(`all`/`tts`/`stt`),返回 `ttsReady` / `sttReady`
|
|
94
|
+
| `voice_list` | 在线/离线发现音色、内置人设与自定义别名 | 可选 `online`(`true` 拉取并 24h 缓存微软 300+ 实时音色,断网自动回退 45+ 精选内置)、`locale`、`gender`(`Female`/`Male`)、`tag`(如 `podcast`/`multilingual`/`dialect`/`child`/`teen`/`mature`/`elder`/`anime`/`documentary`)、`includePersonas`(默认 `true`) |
|
|
95
|
+
| `voice_preview` | 有界并发(≤3)批量试听并生成网页试听页 | 可选 `voices`(≤8,支持原始音色 ID、10 大内置 `persona` ID/名称及 `customVoices` 别名)、`text`(≤200 字)、`outputDir`、`htmlIndex`(默认 `true`,生成 `voice_previews/index.html`) |
|
|
96
|
+
| `voice_health` | 本地配置自检(不触网) | 可选 `scope`(`all`/`tts`/`stt`),返回 `ttsReady` / `sttReady` 并校验引擎、音色/人设/`customVoices` 别名、语速音调、代理与密钥 |
|
|
97
|
+
|
|
98
|
+
### `0.8.0` 语音多样性四层能力一览
|
|
99
|
+
|
|
100
|
+
1. **全量发现与全年龄/方言内置(45+ 内置 / 300+ 在线)**:
|
|
101
|
+
- `voice_list({ online: true })` 联网拉取微软 Edge 300+ 全量神经音色并内存缓存 24 小时,离线自动回退至 45+ 精选内置音色:
|
|
102
|
+
- **童声/幼童**:`zh-CN-XiaoshuangNeural`、`zh-CN-XiaoyouNeural`
|
|
103
|
+
- **少年/动漫**:`zh-CN-YunxiaNeural`
|
|
104
|
+
- **成熟/纪录片/老年**:`zh-CN-YunzeNeural`、`zh-CN-XiaoqiuNeural`、`zh-CN-XiaoruiNeural`
|
|
105
|
+
- **激昂/情感/戏剧**:`zh-CN-YunhaoNeural`、`zh-CN-YunfengNeural`、`zh-CN-XiaohanNeural`、`zh-CN-XiaomoNeural`、`zh-CN-XiaoxuanNeural`
|
|
106
|
+
- **方言与港澳台**:东北(`zh-CN-liaoning-XiaobeiNeural`)、陕西(`zh-CN-shaanxi-XiaoniNeural`)、四川(`zh-CN-sichuan-YunxiNeural`)、河南(`zh-CN-henan-YundengNeural`)、山东(`zh-CN-shandong-YunxiangNeural`)、粤语男女(`zh-HK-WanLungNeural` / `zh-HK-HiuMaanNeural`)、台湾男女(`zh-TW-YunJheNeural` / `zh-TW-HsiaoChenNeural` / `zh-TW-HsiaoYuNeural`)
|
|
107
|
+
2. **10 大开箱即用音色人设(`persona`)**:
|
|
108
|
+
- `late-night-radio`、`podcast-host-female`、`podcast-host-male`、`documentary-narrator`、`bedtime-story`、`anime-boy`、`energetic-anchor`、`news-briefing`、`bilingual-tech-female`、`bilingual-tech-male`。
|
|
109
|
+
3. **情绪演技指令与 Kokoro 混音(`instructions`)**:
|
|
110
|
+
- `gpt-4o-mini-tts` 直接发送原生 `instructions` 字段;
|
|
111
|
+
- SiliconFlow `FunAudioLLM/CosyVoice2-0.5B` 自动将 `instructions` 拼接为 `<|endofprompt|>` 前缀,并支持文本内联 `[laughter]`、`[breath]` 等副语言标记;
|
|
112
|
+
- 自定义 Kokoro 端点支持如 `zf_xiaobei*0.6+zf_xiaoni*0.4` 的音色加权混合表达式。
|
|
113
|
+
4. **零样本参考克隆(`referenceAudio` + `referenceText`)与 `customVoices` 别名**:
|
|
114
|
+
- 在 `siliconflow` 或 `custom` 引擎下传入工作区内 5–10 秒干净语音(≤10MB)及对应参考台词即可零样本克隆;
|
|
115
|
+
- 在 DSH 设置 `customVoices` 配置一次即可按中文或英文别名在 `voice_tts`、`segments[]` 与 `voice_preview` 中热更新复用。
|
|
116
|
+
5. **播客广电级响度均衡(`normalizeLoudness: true`)**:
|
|
117
|
+
- 合成或拼接完成后调用本机 `ffmpeg` 执行 `-16 LUFS`(`loudnorm=I=-16:TP=-1.5:LRA=11`)标准化,消除多角色或跨引擎音色之间的音量落差。
|
|
83
118
|
|
|
84
119
|
### 引擎预设与安全细节
|
|
85
120
|
|
|
86
121
|
- **引擎预设**:
|
|
87
122
|
- `asrEngine`:`groq`(`whisper-large-v3-turbo`)、`openai`(`whisper-1`)、`siliconflow`(`FunAudioLLM/SenseVoiceSmall`)、`custom`(支持本地回环地址免密钥)。
|
|
88
123
|
- `ttsEngine`:`edge`(零密钥默认)、`openai`(`gpt-4o-mini-tts`)、`siliconflow`(`FunAudioLLM/CosyVoice2-0.5B`)、`custom`(OpenAI `/audio/speech` 兼容端点)。
|
|
89
|
-
-
|
|
124
|
+
- **工作区沙箱与符号链接防护**:所有读写路径(含 `inputFile`、`referenceAudio`、`audio` 与各类输出)解析后必须位于 `session.header.cwd` 内;拒绝跟随符号链接覆写,新建文件使用 `O_EXCL` 防止并发竞态覆盖,转写 `.txt` 与字幕在类 Unix 系统以 `0600` 权限写入。
|
|
90
125
|
- **防凭据串台与防重定向泄露**:ASR 与 TTS 请求固定发往配置端点,拒绝模型调用时用 `engine` 临时切换厂商,遇 `3xx` 重定向立即中止请求。
|
|
91
|
-
- **动态超时与随时可取消**:`timeoutMs` 随设置热更新即时生效;`voice_tts`、`voice_preview` 与 `voice_stt` 全程透传 `exec.signal`,取消即关闭连接或中止压缩/上传。
|
|
126
|
+
- **动态超时与随时可取消**:`timeoutMs` 与 `customVoices` 随设置热更新即时生效;`voice_tts`、`voice_preview`、`voice_list` 与 `voice_stt` 全程透传 `exec.signal`,取消即关闭连接或中止压缩/上传。
|
|
92
127
|
|
|
93
128
|
## 安装、卸载与开发
|
|
94
129
|
|
package/lib/config.d.ts
CHANGED
|
@@ -7,6 +7,17 @@
|
|
|
7
7
|
export type TtsEngine = 'edge' | 'openai' | 'siliconflow' | 'custom';
|
|
8
8
|
/** ASR 引擎类型。 */
|
|
9
9
|
export type AsrEngine = 'groq' | 'openai' | 'siliconflow' | 'custom';
|
|
10
|
+
/** 自定义音色与零样本克隆别名。 */
|
|
11
|
+
export interface CustomVoiceAlias {
|
|
12
|
+
name: string;
|
|
13
|
+
voice?: string;
|
|
14
|
+
persona?: string;
|
|
15
|
+
rate?: string;
|
|
16
|
+
pitch?: string;
|
|
17
|
+
instructions?: string;
|
|
18
|
+
referenceAudio?: string;
|
|
19
|
+
referenceText?: string;
|
|
20
|
+
}
|
|
10
21
|
/** 插件行配置(cordis.patch.yml 里的 config 段,可缺省)。 */
|
|
11
22
|
export interface VoiceConfig {
|
|
12
23
|
ttsEngine?: TtsEngine;
|
|
@@ -23,6 +34,7 @@ export interface VoiceConfig {
|
|
|
23
34
|
proxyUrl?: string;
|
|
24
35
|
timeoutMs?: number;
|
|
25
36
|
overwrite?: boolean;
|
|
37
|
+
customVoices?: CustomVoiceAlias[];
|
|
26
38
|
}
|
|
27
39
|
/** 解析后的配置。 */
|
|
28
40
|
export interface ResolvedVoiceConfig {
|
|
@@ -40,6 +52,7 @@ export interface ResolvedVoiceConfig {
|
|
|
40
52
|
proxyUrl: string;
|
|
41
53
|
timeoutMs: number;
|
|
42
54
|
overwrite: boolean;
|
|
55
|
+
customVoices: CustomVoiceAlias[];
|
|
43
56
|
}
|
|
44
57
|
export declare const ASR_PRESETS: Record<'groq' | 'openai' | 'siliconflow', {
|
|
45
58
|
baseUrl: string;
|
|
@@ -57,6 +70,8 @@ export declare function isLoopbackBaseUrl(url: string): boolean;
|
|
|
57
70
|
export declare function resolveAsrApiKey(config: VoiceConfig | undefined, env?: NodeJS.ProcessEnv): string;
|
|
58
71
|
/** TTS 密钥:配置优先,其次环境变量 DSH_VOICE_TTS_KEY。 */
|
|
59
72
|
export declare function resolveTtsApiKey(config: VoiceConfig | undefined, env?: NodeJS.ProcessEnv): string;
|
|
73
|
+
/** 按别名(大小写不敏感)查找自定义音色配置。 */
|
|
74
|
+
export declare function resolveCustomVoice(customVoices: readonly CustomVoiceAlias[], nameOrId: string): CustomVoiceAlias | undefined;
|
|
60
75
|
/**
|
|
61
76
|
* 解析并校验配置:非法字段逐项回退到默认值,其余字段照常生效。
|
|
62
77
|
* @param onWarning 非法字段的告警回调,默认打到 console.warn。
|