dsh-voice 0.6.1 → 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 +18 -0
- package/README.en.md +26 -15
- package/README.md +26 -15
- package/docs/USAGE.en.md +84 -40
- package/docs/USAGE.md +84 -40
- package/lib/config.d.ts +44 -3
- package/lib/config.js +138 -9
- package/lib/edge-tts.d.ts +44 -0
- package/lib/edge-tts.js +305 -37
- package/lib/host-config.d.ts +1 -1
- package/lib/host-config.js +49 -20
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/openai-tts.d.ts +29 -0
- package/lib/openai-tts.js +149 -0
- package/lib/paths.d.ts +4 -0
- package/lib/paths.js +21 -11
- package/lib/proxy-fetch.d.ts +6 -0
- package/lib/proxy-fetch.js +344 -4
- package/lib/stt.d.ts +43 -9
- package/lib/stt.js +164 -14
- package/lib/tools.d.ts +9 -2
- package/lib/tools.js +855 -81
- package/lib/tts-text.d.ts +48 -0
- package/lib/tts-text.js +368 -0
- package/lib/update-client.js +1 -1
- package/lib/voices.d.ts +24 -2
- package/lib/voices.js +179 -25
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +4 -3
- package/skills/voice-workflow/SKILL.md +96 -0
package/lib/voices.js
CHANGED
|
@@ -1,36 +1,190 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 常用音色清单(内置 45 个全年龄段/多风格/方言常用音色与 10 个开箱即用角色人设配方)。
|
|
3
3
|
*
|
|
4
4
|
* @module dsh-voice/voices
|
|
5
5
|
*/
|
|
6
6
|
/** 常用音色。 */
|
|
7
7
|
export const VOICES = [
|
|
8
|
-
{ id: 'zh-CN-XiaoxiaoNeural', gender: 'Female', locale: '普通话(晓晓,温柔女声)' },
|
|
9
|
-
{ id: 'zh-CN-XiaoyiNeural', gender: 'Female', locale: '普通话(晓伊,活泼女声)' },
|
|
10
|
-
{ id: 'zh-CN-YunxiNeural', gender: 'Male', locale: '普通话(云希,青年男声)' },
|
|
11
|
-
{ id: 'zh-CN-YunyangNeural', gender: 'Male', locale: '普通话(云扬,新闻男声)' },
|
|
12
|
-
{ id: 'zh-CN-YunjianNeural', gender: 'Male', locale: '普通话(云健,浑厚男声)' },
|
|
13
|
-
{ id: 'zh-CN-
|
|
14
|
-
{ id: 'zh-CN-
|
|
15
|
-
{ id: 'zh-
|
|
16
|
-
{ id: 'zh-
|
|
17
|
-
{ id: '
|
|
18
|
-
{ id: '
|
|
19
|
-
{ id: '
|
|
20
|
-
{ id: '
|
|
21
|
-
{ id: '
|
|
22
|
-
{ id: '
|
|
23
|
-
{ id: '
|
|
24
|
-
{ id: '
|
|
25
|
-
{ id: '
|
|
26
|
-
{ id: '
|
|
27
|
-
{ id: '
|
|
28
|
-
{ id: '
|
|
29
|
-
{ id: '
|
|
8
|
+
{ id: 'zh-CN-XiaoxiaoNeural', gender: 'Female', locale: '普通话(晓晓,温柔女声)', tags: ['warm', 'podcast'] },
|
|
9
|
+
{ id: 'zh-CN-XiaoyiNeural', gender: 'Female', locale: '普通话(晓伊,活泼女声)', tags: ['lively', 'assistant'] },
|
|
10
|
+
{ id: 'zh-CN-YunxiNeural', gender: 'Male', locale: '普通话(云希,青年男声)', tags: ['youth', 'audiobook'] },
|
|
11
|
+
{ id: 'zh-CN-YunyangNeural', gender: 'Male', locale: '普通话(云扬,新闻男声)', tags: ['news'] },
|
|
12
|
+
{ id: 'zh-CN-YunjianNeural', gender: 'Male', locale: '普通话(云健,浑厚男声)', tags: ['audiobook', 'sports'] },
|
|
13
|
+
{ id: 'zh-CN-XiaoxiaoMultilingualNeural', gender: 'Female', locale: '普通话(晓晓多语,自然中英混读)', tags: ['multilingual', 'podcast', 'warm'] },
|
|
14
|
+
{ id: 'zh-CN-YunyiMultilingualNeural', gender: 'Male', locale: '普通话(云逸多语,自然中英混读)', tags: ['multilingual', 'podcast'] },
|
|
15
|
+
{ id: 'zh-CN-YunfanMultilingualNeural', gender: 'Male', locale: '普通话(云帆多语,播客男声)', tags: ['multilingual', 'podcast'] },
|
|
16
|
+
{ id: 'zh-CN-XiaoshuangNeural', gender: 'Female', locale: '普通话(晓双,灵动女童/绘本)', tags: ['child', 'cute', 'story'] },
|
|
17
|
+
{ id: 'zh-CN-XiaoyouNeural', gender: 'Female', locale: '普通话(晓悠,童真幼童)', tags: ['child', 'cute', 'story'] },
|
|
18
|
+
{ id: 'zh-CN-YunxiaNeural', gender: 'Male', locale: '普通话(云夏,热血少年/动漫旁白)', tags: ['teen', 'anime', 'story'] },
|
|
19
|
+
{ id: 'zh-CN-YunzeNeural', gender: 'Male', locale: '普通话(云泽,沉稳大叔/纪录片)', tags: ['mature', 'documentary', 'audiobook'] },
|
|
20
|
+
{ id: 'zh-CN-XiaoqiuNeural', gender: 'Female', locale: '普通话(晓秋,知性成熟女声)', tags: ['mature', 'audiobook', 'warm'] },
|
|
21
|
+
{ id: 'zh-CN-XiaoruiNeural', gender: 'Female', locale: '普通话(晓睿,慈祥老年女声)', tags: ['elder', 'story'] },
|
|
22
|
+
{ id: 'zh-CN-YunhaoNeural', gender: 'Male', locale: '普通话(云皓,激昂广告/赛事解说)', tags: ['passion', 'sports', 'commercial'] },
|
|
23
|
+
{ id: 'zh-CN-YunfengNeural', gender: 'Male', locale: '普通话(云枫,磁性质感男声)', tags: ['audiobook', 'drama'] },
|
|
24
|
+
{ id: 'zh-CN-XiaohanNeural', gender: 'Female', locale: '普通话(晓涵,温婉情感女声)', tags: ['warm', 'drama'] },
|
|
25
|
+
{ id: 'zh-CN-XiaomoNeural', gender: 'Female', locale: '普通话(晓墨,故事演绎女声)', tags: ['audiobook', 'drama'] },
|
|
26
|
+
{ id: 'zh-CN-XiaoxuanNeural', gender: 'Female', locale: '普通话(晓萱,清冷御姐女声)', tags: ['cool', 'drama'] },
|
|
27
|
+
{ id: 'zh-CN-liaoning-XiaobeiNeural', gender: 'Female', locale: '东北话(晓北)', tags: ['dialect'] },
|
|
28
|
+
{ id: 'zh-CN-shaanxi-XiaoniNeural', gender: 'Female', locale: '陕西话(晓妮)', tags: ['dialect'] },
|
|
29
|
+
{ id: 'zh-CN-sichuan-YunxiNeural', gender: 'Male', locale: '四川话(云希)', tags: ['dialect'] },
|
|
30
|
+
{ id: 'zh-CN-henan-YundengNeural', gender: 'Male', locale: '河南话(云登,幽默男声)', tags: ['dialect', 'humorous'] },
|
|
31
|
+
{ id: 'zh-CN-shandong-YunxiangNeural', gender: 'Male', locale: '山东话(云翔,豪爽男声)', tags: ['dialect'] },
|
|
32
|
+
{ id: 'zh-TW-HsiaoChenNeural', gender: 'Female', locale: '台湾腔(晓臻)', tags: ['dialect', 'warm'] },
|
|
33
|
+
{ id: 'zh-TW-HsiaoYuNeural', gender: 'Female', locale: '台湾腔(晓雨,女声)', tags: ['dialect', 'warm'] },
|
|
34
|
+
{ id: 'zh-TW-YunJheNeural', gender: 'Male', locale: '台湾腔(允哲,男声)', tags: ['dialect', 'podcast'] },
|
|
35
|
+
{ id: 'zh-HK-HiuMaanNeural', gender: 'Female', locale: '粤语(曉曼)', tags: ['dialect'] },
|
|
36
|
+
{ id: 'zh-HK-WanLungNeural', gender: 'Male', locale: '粤语(雲龍,男声)', tags: ['dialect', 'podcast'] },
|
|
37
|
+
{ id: 'en-US-AriaNeural', gender: 'Female', locale: '美式英语(Aria,女声)', tags: ['podcast', 'news'] },
|
|
38
|
+
{ id: 'en-US-JennyNeural', gender: 'Female', locale: '美式英语(Jenny,女声)', tags: ['warm', 'assistant'] },
|
|
39
|
+
{ id: 'en-US-GuyNeural', gender: 'Male', locale: '美式英语(Guy,男声)', tags: ['news'] },
|
|
40
|
+
{ id: 'en-US-DavisNeural', gender: 'Male', locale: '美式英语(Davis,男声)', tags: ['podcast', 'warm'] },
|
|
41
|
+
{ id: 'en-US-AndrewMultilingualNeural', gender: 'Male', locale: '美式英语(Andrew 多语,温暖播客)', tags: ['multilingual', 'podcast', 'warm'] },
|
|
42
|
+
{ id: 'en-US-AvaMultilingualNeural', gender: 'Female', locale: '美式英语(Ava 多语,自然清晰)', tags: ['multilingual', 'podcast'] },
|
|
43
|
+
{ id: 'en-US-EmmaMultilingualNeural', gender: 'Female', locale: '美式英语(Emma 多语,亲和解说)', tags: ['multilingual', 'warm'] },
|
|
44
|
+
{ id: 'en-GB-SoniaNeural', gender: 'Female', locale: '英式英语(Sonia)', tags: ['news'] },
|
|
45
|
+
{ id: 'en-GB-RyanNeural', gender: 'Male', locale: '英式英语(Ryan)', tags: ['podcast'] },
|
|
46
|
+
{ id: 'ja-JP-NanamiNeural', gender: 'Female', locale: '日语(Nanami,女声)', tags: ['assistant'] },
|
|
47
|
+
{ id: 'ja-JP-KeitaNeural', gender: 'Male', locale: '日语(Keita,男声)', tags: ['podcast'] },
|
|
48
|
+
{ id: 'ko-KR-SunHiNeural', gender: 'Female', locale: '韩语(SunHi)', tags: ['assistant'] },
|
|
49
|
+
{ id: 'fr-FR-DeniseNeural', gender: 'Female', locale: '法语(Denise)', tags: ['podcast'] },
|
|
50
|
+
{ id: 'de-DE-KatjaNeural', gender: 'Female', locale: '德语(Katja)', tags: ['assistant'] },
|
|
51
|
+
{ id: 'ru-RU-SvetlanaNeural', gender: 'Female', locale: '俄语(Svetlana)', tags: ['assistant'] },
|
|
52
|
+
{ id: 'es-ES-ElviraNeural', gender: 'Female', locale: '西班牙语(Elvira)', tags: ['assistant'] },
|
|
30
53
|
];
|
|
31
|
-
/**
|
|
54
|
+
/** 开箱即用角色人设配方(可直接传给 voice_tts / voice_preview 的 persona 参数)。 */
|
|
55
|
+
export const VOICE_PERSONAS = [
|
|
56
|
+
{
|
|
57
|
+
id: 'late-night-radio',
|
|
58
|
+
label: '深夜电台',
|
|
59
|
+
voice: 'zh-CN-YunfengNeural',
|
|
60
|
+
rate: '-10%',
|
|
61
|
+
pitch: '-3Hz',
|
|
62
|
+
pauseMs: 420,
|
|
63
|
+
description: '磁性低沉、舒缓放松的深夜情感电台声线',
|
|
64
|
+
tags: ['radio', 'warm', 'night', 'audiobook'],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'podcast-host-female',
|
|
68
|
+
label: '播客女主持',
|
|
69
|
+
voice: 'zh-CN-XiaoxiaoNeural',
|
|
70
|
+
rate: '+5%',
|
|
71
|
+
pitch: '+0Hz',
|
|
72
|
+
pauseMs: 280,
|
|
73
|
+
description: '亲和自然、节奏明快的女声对谈播客主持',
|
|
74
|
+
tags: ['podcast', 'warm', 'host'],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'podcast-host-male',
|
|
78
|
+
label: '播客男主持',
|
|
79
|
+
voice: 'zh-CN-YunyiMultilingualNeural',
|
|
80
|
+
rate: '+4%',
|
|
81
|
+
pitch: '+0Hz',
|
|
82
|
+
pauseMs: 280,
|
|
83
|
+
description: '松弛自然、支持中英混读的男声播客主持',
|
|
84
|
+
tags: ['podcast', 'multilingual', 'host'],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'documentary-narrator',
|
|
88
|
+
label: '纪录片旁白',
|
|
89
|
+
voice: 'zh-CN-YunzeNeural',
|
|
90
|
+
rate: '-8%',
|
|
91
|
+
pitch: '-2Hz',
|
|
92
|
+
pauseMs: 450,
|
|
93
|
+
description: '沉稳厚重、富有画面感与纵深感的纪录片大叔旁白',
|
|
94
|
+
tags: ['documentary', 'mature', 'audiobook'],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'bedtime-story',
|
|
98
|
+
label: '睡前故事',
|
|
99
|
+
voice: 'zh-CN-XiaoshuangNeural',
|
|
100
|
+
rate: '-10%',
|
|
101
|
+
pitch: '+2Hz',
|
|
102
|
+
pauseMs: 400,
|
|
103
|
+
description: '灵动温柔、适合儿童绘本与睡前伴读的亲切声线',
|
|
104
|
+
tags: ['child', 'story', 'warm'],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'anime-boy',
|
|
108
|
+
label: '热血少年',
|
|
109
|
+
voice: 'zh-CN-YunxiaNeural',
|
|
110
|
+
rate: '+10%',
|
|
111
|
+
pitch: '+4Hz',
|
|
112
|
+
pauseMs: 220,
|
|
113
|
+
description: '元气满满、充满少年感与戏剧张力的二次元/动漫声线',
|
|
114
|
+
tags: ['teen', 'anime', 'story'],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 'energetic-anchor',
|
|
118
|
+
label: '激情解说',
|
|
119
|
+
voice: 'zh-CN-YunhaoNeural',
|
|
120
|
+
rate: '+14%',
|
|
121
|
+
pitch: '+3Hz',
|
|
122
|
+
pauseMs: 180,
|
|
123
|
+
description: '高亢激昂、感染力极强的广告宣传与赛事解说声线',
|
|
124
|
+
tags: ['passion', 'sports', 'commercial'],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'news-briefing',
|
|
128
|
+
label: '新闻简报',
|
|
129
|
+
voice: 'zh-CN-YunyangNeural',
|
|
130
|
+
rate: '+6%',
|
|
131
|
+
pitch: '+0Hz',
|
|
132
|
+
pauseMs: 260,
|
|
133
|
+
description: '字正腔圆、专业干练的每日资讯与早报播报员',
|
|
134
|
+
tags: ['news', 'professional'],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: 'bilingual-tech-female',
|
|
138
|
+
label: '双语科技女声',
|
|
139
|
+
voice: 'zh-CN-XiaoxiaoMultilingualNeural',
|
|
140
|
+
rate: '+6%',
|
|
141
|
+
pitch: '+0Hz',
|
|
142
|
+
pauseMs: 260,
|
|
143
|
+
description: '流畅中英混读、清晰知性的技术分享与教程女声',
|
|
144
|
+
tags: ['multilingual', 'tech', 'podcast'],
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: 'bilingual-tech-male',
|
|
148
|
+
label: '双语科技男声',
|
|
149
|
+
voice: 'en-US-AndrewMultilingualNeural',
|
|
150
|
+
rate: '+5%',
|
|
151
|
+
pitch: '+0Hz',
|
|
152
|
+
pauseMs: 260,
|
|
153
|
+
description: '自然双语切换、适合硬核科技播客与开发解读的男声',
|
|
154
|
+
tags: ['multilingual', 'tech', 'podcast'],
|
|
155
|
+
},
|
|
156
|
+
];
|
|
157
|
+
const EDGE_VOICE_ID_PATTERN = /^[a-z]{2,3}(?:-[A-Za-z]{2,12}){1,2}-[A-Z][A-Za-z0-9]+(?:-[A-Za-z0-9]+)?(?::[A-Za-z0-9]+)?Neural$/;
|
|
158
|
+
/** 校验音色 id:常用清单内或符合 edge-tts 命名规则(含方言/文字子标签/多语/HD 变体)。 */
|
|
32
159
|
export function isValidVoiceId(id) {
|
|
33
160
|
if (VOICES.some((voice) => voice.id === id))
|
|
34
161
|
return true;
|
|
35
|
-
return
|
|
162
|
+
return EDGE_VOICE_ID_PATTERN.test(id);
|
|
163
|
+
}
|
|
164
|
+
/** 按人设 ID 或中文名称匹配内置角色人设配方(大小写不敏感)。 */
|
|
165
|
+
export function resolvePersona(idOrLabel) {
|
|
166
|
+
const needle = idOrLabel.trim().toLowerCase();
|
|
167
|
+
if (needle === '')
|
|
168
|
+
return undefined;
|
|
169
|
+
return VOICE_PERSONAS.find((persona) => persona.id.toLowerCase() === needle || persona.label.toLowerCase() === needle);
|
|
170
|
+
}
|
|
171
|
+
/** 按地区/语言、性别或标签筛选音色列表(默认筛选内置常用音色)。 */
|
|
172
|
+
export function filterVoices(filter, sourceVoices = VOICES) {
|
|
173
|
+
const locale = filter?.locale?.trim().toLowerCase() ?? '';
|
|
174
|
+
const gender = filter?.gender?.trim().toLowerCase() ?? '';
|
|
175
|
+
const tag = filter?.tag?.trim().toLowerCase() ?? '';
|
|
176
|
+
if (locale === '' && gender === '' && tag === '')
|
|
177
|
+
return sourceVoices;
|
|
178
|
+
return sourceVoices.filter((voice) => {
|
|
179
|
+
if (locale !== '' && !voice.id.toLowerCase().includes(locale) && !voice.locale.toLowerCase().includes(locale)) {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
if (gender !== '' && voice.gender.toLowerCase() !== gender) {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
if (tag !== '' && !(voice.tags?.some((item) => item.toLowerCase().includes(tag)) ?? false)) {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
return true;
|
|
189
|
+
});
|
|
36
190
|
}
|
package/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Voice",
|
|
4
|
-
"description": "Keyless Edge
|
|
4
|
+
"description": "Keyless Edge (300+ online voices & all-age/dialect built-ins) & OpenAI/SiliconFlow TTS with 10 personas, emotion/acting instructions, zero-shot cloning & customVoices aliases, Markdown cleanup, multi-speaker podcasts with loudness mastering, SRT/VTT subtitles, browser previews, and multi-engine STT."
|
|
5
5
|
}
|
|
6
6
|
}
|
package/locale/zh.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "语音",
|
|
4
|
-
"description": "零密钥 Edge
|
|
4
|
+
"description": "零密钥 Edge(300+ 在线音色与全年龄/方言内置)及 OpenAI/SiliconFlow 语音合成(TTS)、10 大音色人设、情绪演技指令、零样本克隆与自定义别名、长文清理、多角色播客与响度均衡、SRT/VTT 字幕、网页试听及多引擎语音转文字(STT)。"
|
|
5
5
|
}
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-voice",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "DeepSeek Harness 语音插件:零密钥 Edge TTS
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "DeepSeek Harness 语音插件:零密钥 Edge TTS 朗读、多角色播客与字幕导出、音色试听、兼容 ASR 转写与工作区输出保护。欢迎提交 issues 和 PR。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"LICENSES",
|
|
28
28
|
"THIRD_PARTY_NOTICES.md",
|
|
29
29
|
"assets/plugin-icon.webp",
|
|
30
|
-
"locale"
|
|
30
|
+
"locale",
|
|
31
|
+
"skills"
|
|
31
32
|
],
|
|
32
33
|
"scripts": {
|
|
33
34
|
"build": "tsc -p tsconfig.json && node scripts/build-updates.mjs",
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: voice-workflow
|
|
3
|
+
description: Best-practice workflows for dsh-voice: 300+ online Edge voice discovery, 10 built-in voice personas, emotion/acting instructions, zero-shot reference cloning & customVoices aliases, direct file TTS with Markdown cleanup, oral script adaptation, multi-speaker podcasts with -16 LUFS loudness mastering, SRT/VTT subtitle export, interactive voice auditions, and large-recording transcription. Load when turning documents/notes into speech, producing podcasts/subtitles, cloning voices, or transcribing audio.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Voice Workflow (`dsh-voice`)
|
|
7
|
+
|
|
8
|
+
Use this guide when converting articles, notes, or briefings into audio/subtitles, auditioning voices/personas, cloning reference voices, or transcribing recordings inside the active session workspace.
|
|
9
|
+
|
|
10
|
+
## 1. Discover Voices, Pick Personas & Audition Before Long Renders
|
|
11
|
+
|
|
12
|
+
- **Online 300+ Edge voice catalog + 45+ curated built-ins**:
|
|
13
|
+
- Call `voice_list({ online: true, locale, gender, tag })` to fetch and cache (24h in-memory) Microsoft's live 300+ neural voice catalog. If offline or unreachable, it falls back automatically (`source: "builtin-fallback"`) to 45+ curated voices spanning child (`zh-CN-XiaoshuangNeural`, `zh-CN-XiaoyouNeural`), teen/anime (`zh-CN-YunxiaNeural`), mature/documentary (`zh-CN-YunzeNeural`, `zh-CN-XiaoqiuNeural`), elder (`zh-CN-XiaoruiNeural`), passionate (`zh-CN-YunhaoNeural`), and dialects (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 `zh-HK-WanLungNeural` / `zh-HK-HiuMaanNeural`, Taiwanese `zh-TW-YunJheNeural` / `zh-TW-HsiaoChenNeural` / `zh-TW-HsiaoYuNeural`).
|
|
14
|
+
- `voice_list` also returns `personas` (unless `includePersonas: false`) and any `customVoices` aliases configured in DSH Settings.
|
|
15
|
+
- **10 ready-made personas (`persona`)**:
|
|
16
|
+
- Use `persona` in `voice_tts`, `segments[]`, or `voice_preview` for instant character tuning (`voice`, `rate`, `pitch`, `pauseMs`):
|
|
17
|
+
`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`.
|
|
18
|
+
- **Interactive audition page**:
|
|
19
|
+
- Call `voice_preview({ voices: [...], text })` with raw voice IDs, built-in `persona` IDs/labels, or `customVoices` alias names. It writes MP3 samples and an interactive `voice_previews/index.html` browser audition page (with playback speed toggles and one-click ID copy).
|
|
20
|
+
|
|
21
|
+
## 2. Direct File Synthesis & Markdown Cleanup (`inputFile`)
|
|
22
|
+
|
|
23
|
+
- **Do not copy large `.md` or `.txt` files into `text` arguments.** Pass `inputFile` directly to `voice_tts`:
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"inputFile": "docs/article.md",
|
|
27
|
+
"persona": "documentary-narrator",
|
|
28
|
+
"output": "article.mp3"
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
- `cleanMarkdown` defaults to `true` when `inputFile` ends with `.md` or `.markdown` (pass `cleanMarkdown: true` explicitly for inline Markdown in `text`). It strips fenced code blocks, URLs, Markdown links/images, headings, emphasis markers, and HTML tags while preserving punctuation and paragraph breaks.
|
|
32
|
+
- Texts longer than `5,000` characters (up to `100,000` characters) are automatically split on sentence/clause boundaries and merged into a single seamless MP3 in one `voice_tts` call.
|
|
33
|
+
|
|
34
|
+
## 3. Oral Script Adaptation for Briefings
|
|
35
|
+
|
|
36
|
+
When the user asks to summarize notes, changelogs, or reports into a spoken briefing rather than reading a file verbatim:
|
|
37
|
+
|
|
38
|
+
- Rewrite bullet lists, Markdown tables, code identifiers, and bare URLs into natural spoken sentences before calling `voice_tts`.
|
|
39
|
+
- Spell out or paraphrase abbreviations and symbols (e.g., turn `->`, `>=`, or file paths into natural transitions) so the narration sounds like a human host.
|
|
40
|
+
- Keep target duration in mind (roughly 220–260 Chinese characters or 130–160 English words per minute at `+0%` rate).
|
|
41
|
+
|
|
42
|
+
## 4. Multi-Speaker Podcasts, Emotion Acting & Loudness Mastering
|
|
43
|
+
|
|
44
|
+
Produce two-host or multi-role dialogues in a single MP3 using `voice_tts` `segments` (up to 50 segments per call), with optional per-segment `persona`, `instructions`, `referenceAudio`/`referenceText`, and `-16 LUFS` broadcast loudness mastering:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"segments": [
|
|
49
|
+
{
|
|
50
|
+
"persona": "podcast-host-female",
|
|
51
|
+
"text": "欢迎收听本期技术早报,今天我们来聊聊最新的语音工作流。",
|
|
52
|
+
"pauseMs": 350
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"persona": "podcast-host-male",
|
|
56
|
+
"text": "没错,现在长文稿、人设配音和响度均衡都可以一次搞定。",
|
|
57
|
+
"rate": "+5%",
|
|
58
|
+
"pauseMs": 300
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"normalizeLoudness": true,
|
|
62
|
+
"output": "podcast.mp3",
|
|
63
|
+
"subtitleOutput": "podcast.srt"
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- **Emotion, acting & paralinguistics (`instructions`)**:
|
|
68
|
+
- Pass natural-language acting prompts via `instructions` on `voice_tts` or per segment in `segments[]`.
|
|
69
|
+
- On SiliconFlow `CosyVoice2-0.5B`, `instructions` is automatically prepended with `<|endofprompt|>` and supports inline `[laughter]` and `[breath]` tags.
|
|
70
|
+
- On OpenAI `gpt-4o-mini-tts`, `instructions` is passed natively as the top-level API parameter.
|
|
71
|
+
- On custom Kokoro endpoints, `voice` also accepts voice-blending expressions such as `zf_xiaobei*0.6+zf_xiaoni*0.4`.
|
|
72
|
+
- **Podcast loudness mastering (`normalizeLoudness: true`)**:
|
|
73
|
+
- Runs local `ffmpeg` (`loudnorm=I=-16:TP=-1.5:LRA=11`) after concatenation so multi-speaker or cross-voice podcasts have consistent broadcast volume. (Requires `ffmpeg` installed locally.)
|
|
74
|
+
|
|
75
|
+
## 5. Zero-Shot Voice Cloning (`referenceAudio`) & `customVoices` Aliases
|
|
76
|
+
|
|
77
|
+
- **Zero-shot reference cloning**:
|
|
78
|
+
- Pass a 5–10 second clean workspace speech clip (`≤10 MB`, `.wav`/`.mp3`/etc.) in `referenceAudio` alongside its transcript in `referenceText` on `voice_tts` or `segments[]`.
|
|
79
|
+
- Requires `ttsEngine` set to `siliconflow` (`FunAudioLLM/CosyVoice2-0.5B`) or `custom` (e.g., local GPT-SoVITS / IndexTTS). Using `referenceAudio` while `ttsEngine: "edge"` throws an actionable error guiding the user to switch engines.
|
|
80
|
+
- **Reusable named aliases (`customVoices`)**:
|
|
81
|
+
- Users can save named characters (`name`, `voice`, `persona`, `rate`, `pitch`, `instructions`, `referenceAudio`, `referenceText`) in DSH Settings `customVoices` (live-reloaded without restart) and invoke them by `name` in `voice_tts`, `segments[]`, or `voice_preview`.
|
|
82
|
+
|
|
83
|
+
## 6. Synchronized Subtitles for Video Pipelines (`subtitleOutput`)
|
|
84
|
+
|
|
85
|
+
- Pass `subtitleOutput: "out.srt"` or `"out.vtt"` to `voice_tts` (single-speaker or `segments`) to export synchronized sentence-boundary subtitles alongside the MP3 at zero extra API cost.
|
|
86
|
+
- Pass `subtitleOutput: "transcript.srt"` (or `.vtt`) to `voice_stt` to automatically request word/segment timestamps and write subtitles alongside the transcript.
|
|
87
|
+
- Hand the resulting `.mp3` and `.srt`/`.vtt` files directly to `dsh-ffmpeg` for subtitle burn-in or `dsh-remotion` for timeline composition.
|
|
88
|
+
|
|
89
|
+
## 7. Meeting Transcription & Health Checks
|
|
90
|
+
|
|
91
|
+
- **Domain accuracy**: Pass project names, acronyms, and speaker terms in `voice_stt({ audio, prompt: "DeepSeek Harness, Cordis, ...", output: "meeting.txt" })`.
|
|
92
|
+
- **Large recordings (>25 MB)**: Pass `autoCompress: true` to `voice_stt`. When local `ffmpeg` is available, `dsh-voice` automatically transcodes (16kHz mono) and splits recordings larger than 24 MB into segments, merges the transcript, and shifts subtitle timestamps accurately.
|
|
93
|
+
- **Local / keyless Whisper**: If `asrEngine` is `custom` pointing to a loopback URL (e.g. `http://127.0.0.1:8000/v1`), no `asrApiKey` is required.
|
|
94
|
+
- **Scoped diagnostics**:
|
|
95
|
+
- Run `voice_health({ scope: "tts" })` before TTS-only tasks so an unconfigured ASR key does not trigger false alarms (also recognizes built-in `persona` IDs and `customVoices` aliases as valid `ttsVoice` values).
|
|
96
|
+
- Run `voice_health({ scope: "stt" })` before transcription, or `voice_health()` (default `all`) for full engine, voice/prosody, proxy (`http://`, `https://`, `socks5://`, `socks5h://`), and key diagnostics.
|