dsh-voice 0.5.4 → 0.5.5
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 +5 -0
- package/docs/USAGE.en.md +12 -0
- package/docs/USAGE.md +12 -0
- package/lib/tools.js +42 -8
- package/lib/update-client.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# 更新记录
|
|
2
2
|
|
|
3
|
+
## 0.5.5 (2026-11-03)
|
|
4
|
+
|
|
5
|
+
- voice_stt 显示落盘路径;voice_health 失败项带 hint 与影响面;使用说明补齐排错。
|
|
6
|
+
- voice_stt reports the transcript path, voice_health adds hints and scope, and troubleshooting docs are added.
|
|
7
|
+
|
|
3
8
|
## 0.5.4 (2026-10-30)
|
|
4
9
|
|
|
5
10
|
- 重整中英文首页:用途、三步流程图、安装入口与操作示例;详细配置与边界集中到完整说明。
|
package/docs/USAGE.en.md
CHANGED
|
@@ -69,6 +69,18 @@ voice_health {} # self-check TTS /
|
|
|
69
69
|
- **The key only goes to the configured endpoint**: ASR always uses `asrBaseUrl` from config (the groq/openai presets are defaults only); an `engine` argument that differs from config is rejected instead of shipping the key to another vendor.
|
|
70
70
|
- Protocol aligned with current open-source edge-tts (7.x) — no reliance on the outdated token endpoint
|
|
71
71
|
|
|
72
|
+
## Troubleshooting
|
|
73
|
+
|
|
74
|
+
Run `voice_health` first: it makes no network requests and reports the TTS voice, proxy and ASR engine/endpoint/key one by one. Every failing check carries its fix and states the impact (a missing key only breaks `voice_stt`; the three TTS tools keep working).
|
|
75
|
+
|
|
76
|
+
- **Invalid voice id**: pick one from `voice_list` (ids look like `zh-CN-XiaoxiaoNeural`), or change `ttsVoice` in config and restart.
|
|
77
|
+
- **TTS reports a network error**: Edge read-aloud is a third-party online service and needs internet access. Behind a corporate network or proxy, set `proxyUrl` to an http(s) proxy such as `http://127.0.0.1:7890`.
|
|
78
|
+
- **STT reports a missing key or endpoint**: set `DSH_VOICE_ASR_KEY` (recommended; keeps the key out of config files) or configure `asrApiKey`. With `asrEngine: custom` you must also provide `asrBaseUrl`.
|
|
79
|
+
- **STT says the audio is missing or out of scope**: `audio` and every output must stay inside the current session workspace; copy outside recordings in first.
|
|
80
|
+
- **Transcription refused with a 3xx**: the plugin stops instead of posting audio to the redirect target. Set `asrBaseUrl` to the trusted final endpoint.
|
|
81
|
+
- **Same-name output was not overwritten**: with `overwrite: false` (default) the file is suffixed; use the `output` / `transcriptFile` the tool returned.
|
|
82
|
+
- **Timeouts**: `timeoutMs` defaults to 60000, clamped to 5000-600000; raise it for large files or slow services.
|
|
83
|
+
|
|
72
84
|
## Development
|
|
73
85
|
|
|
74
86
|
```bash
|
package/docs/USAGE.md
CHANGED
|
@@ -69,6 +69,18 @@ voice_health {} # 自检 TTS / ASR /
|
|
|
69
69
|
- **并发生成不覆盖**:`overwrite=false` 时即使两个任务同时写同名文件,或合成期间出现用户同名文件,也会另存并返回实际文件名。显式覆盖只接受没有硬链接的普通文件。
|
|
70
70
|
- Edge TTS 协议适配保留在插件实现中,不使用旧令牌端点。
|
|
71
71
|
|
|
72
|
+
## 排错
|
|
73
|
+
|
|
74
|
+
先跑 `voice_health`:它不发网络请求,逐项报 TTS 音色、代理、ASR 引擎/地址/密钥;失败项带修复动作,并说明影响面(缺密钥只影响 `voice_stt`,三个 TTS 工具照常可用)。
|
|
75
|
+
|
|
76
|
+
- **音色不合法**:用 `voice_list` 挑清单内 id(形如 `zh-CN-XiaoxiaoNeural`),或改配置 `ttsVoice` 后重启。
|
|
77
|
+
- **TTS 报网络错误**:Edge 朗读是第三方在线服务,需要能访问外网;公司网络或代理下配置 `proxyUrl`(例如 `http://127.0.0.1:7890`)。
|
|
78
|
+
- **STT 报缺密钥/接口地址**:设环境变量 `DSH_VOICE_ASR_KEY`(推荐,不落配置文件)或配置 `asrApiKey`;`asrEngine: custom` 时必须给 `asrBaseUrl`。
|
|
79
|
+
- **STT 报音频不存在或越界**:`audio` 与本插件的所有输出都必须落在当前会话工作区内,工作区外的录音先复制进来。
|
|
80
|
+
- **转写被拒(3xx)**:接口返回重定向时插件会停止,不向跳转地址发送音频;请把 `asrBaseUrl` 设为可信的最终接口地址。
|
|
81
|
+
- **同名输出没被覆盖**:`overwrite: false`(默认)下自动加序号,请以工具返回的 `output` / `transcriptFile` 为准。
|
|
82
|
+
- **超时**:`timeoutMs` 默认 60000,最小 5000、最大 600000;大文件或慢服务调大它。
|
|
83
|
+
|
|
72
84
|
## 开发
|
|
73
85
|
|
|
74
86
|
```bash
|
package/lib/tools.js
CHANGED
|
@@ -221,7 +221,12 @@ export function buildVoiceTools(config, deps = {}) {
|
|
|
221
221
|
schema: sttSchema,
|
|
222
222
|
render: (_args, value) => {
|
|
223
223
|
const rec = asRecord(value);
|
|
224
|
-
|
|
224
|
+
const lines = ['转写完成(模型 ' + rec.model + '):' + rec.text];
|
|
225
|
+
// 用户明确要了 output 就得看到落在哪儿,否则等于没保存。
|
|
226
|
+
const saved = typeof rec.transcriptFile === 'string' ? rec.transcriptFile : '';
|
|
227
|
+
if (saved !== '')
|
|
228
|
+
lines.push('', '转写文本已写入:' + saved);
|
|
229
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
225
230
|
},
|
|
226
231
|
},
|
|
227
232
|
async execute(rawArgs, exec) {
|
|
@@ -353,27 +358,56 @@ export function buildVoiceTools(config, deps = {}) {
|
|
|
353
358
|
const c = asRecord(item);
|
|
354
359
|
lines.push('- ' + c.name + ':' + (c.ok === true ? '✅ ' + String(c.detail ?? '') : '❌ ' + String(c.detail ?? '')));
|
|
355
360
|
}
|
|
361
|
+
// 自检要给出下一步:失败项各自的修复动作,而不是只报红。
|
|
362
|
+
const hints = Array.isArray(rec.hints) ? rec.hints : [];
|
|
363
|
+
if (hints.length > 0) {
|
|
364
|
+
lines.push('', '建议:');
|
|
365
|
+
for (const hint of hints)
|
|
366
|
+
lines.push('- ' + String(hint));
|
|
367
|
+
}
|
|
356
368
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
357
369
|
},
|
|
358
370
|
},
|
|
359
371
|
async execute() {
|
|
360
372
|
const checks = [];
|
|
373
|
+
const hints = [];
|
|
361
374
|
let ok = true;
|
|
362
375
|
const voiceOk = isValidVoiceId(cfg.ttsVoice);
|
|
363
|
-
checks.push({
|
|
364
|
-
|
|
376
|
+
checks.push({
|
|
377
|
+
name: 'TTS 音色',
|
|
378
|
+
ok: voiceOk,
|
|
379
|
+
detail: voiceOk ? cfg.ttsVoice : '不合法:' + cfg.ttsVoice + '(用 voice_list 查看)',
|
|
380
|
+
...(voiceOk ? {} : { hint: '运行 voice_list 挑一个清单内音色,填回 ttsVoice;合法 id 形如 zh-CN-XiaoxiaoNeural。' }),
|
|
381
|
+
});
|
|
382
|
+
if (!voiceOk) {
|
|
365
383
|
ok = false;
|
|
384
|
+
hints.push('TTS 音色不合法:先 voice_list 选音色,再改配置 ttsVoice 并重启 DSH;在此之前 voice_tts 调用会直接报错。');
|
|
385
|
+
}
|
|
366
386
|
checks.push({ name: '特殊代理', ok: true, detail: cfg.proxyUrl !== '' ? '已配置 ' + cfg.proxyUrl : '未配置' });
|
|
367
387
|
checks.push({ name: 'ASR 引擎', ok: true, detail: cfg.asrEngine });
|
|
368
388
|
const baseUrlOk = cfg.asrBaseUrl !== '';
|
|
369
|
-
checks.push({
|
|
370
|
-
|
|
389
|
+
checks.push({
|
|
390
|
+
name: 'ASR 接口地址',
|
|
391
|
+
ok: baseUrlOk,
|
|
392
|
+
detail: baseUrlOk ? cfg.asrBaseUrl : '未配置:asrEngine=custom 时必须提供 asrBaseUrl。',
|
|
393
|
+
...(baseUrlOk ? {} : { hint: 'asrEngine=custom 时补上 asrBaseUrl(含 /v1 的 OpenAI 兼容地址),或改回 groq / openai 预设。' }),
|
|
394
|
+
});
|
|
395
|
+
if (!baseUrlOk) {
|
|
371
396
|
ok = false;
|
|
397
|
+
hints.push('ASR 接口地址缺失:只有 voice_stt 受影响,voice_tts / voice_list / voice_preview 仍可用。');
|
|
398
|
+
}
|
|
372
399
|
const hasKey = cfg.asrApiKey !== '' || typeof process.env.DSH_VOICE_ASR_KEY === 'string' && process.env.DSH_VOICE_ASR_KEY !== '';
|
|
373
|
-
checks.push({
|
|
374
|
-
|
|
400
|
+
checks.push({
|
|
401
|
+
name: 'ASR 密钥',
|
|
402
|
+
ok: hasKey,
|
|
403
|
+
detail: hasKey ? '已配置' : '未配置:voice_stt 需要 DSH_VOICE_ASR_KEY 环境变量或配置 asrApiKey',
|
|
404
|
+
...(hasKey ? {} : { hint: '设置环境变量 DSH_VOICE_ASR_KEY(推荐,不落配置文件)或配置 asrApiKey,然后重启 DSH;密钥缺失只影响 voice_stt。' }),
|
|
405
|
+
});
|
|
406
|
+
if (!hasKey) {
|
|
375
407
|
ok = false;
|
|
376
|
-
|
|
408
|
+
hints.push('缺 ASR 密钥:voice_stt 无法转写;TTS 三个工具不需要密钥,可以先正常用。');
|
|
409
|
+
}
|
|
410
|
+
return { ok, plugin: 'dsh-voice', checks, ...(hints.length > 0 ? { hints } : {}) };
|
|
377
411
|
},
|
|
378
412
|
timeoutMs: 5000,
|
|
379
413
|
};
|
package/lib/update-client.js
CHANGED
|
@@ -437,7 +437,7 @@ function __stardustUpdatesClient(ctx, React, require, shared) {
|
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
/* STARDUSTLC_UPDATE_CLIENT_BODY_START */
|
|
440
|
-
window.__ModuleLoader__.load(__stardustUpdatesWrap({id:"dsh-voice",factory:require=>({apply(){}})},{"name":"dsh-voice","version":"0.1.0","hasWorkbench":false,"packageVersion":"0.5.
|
|
440
|
+
window.__ModuleLoader__.load(__stardustUpdatesWrap({id:"dsh-voice",factory:require=>({apply(){}})},{"name":"dsh-voice","version":"0.1.0","hasWorkbench":false,"packageVersion":"0.5.5","label":"语音","labelEn":"Voice","suiteComponent":true}));
|
|
441
441
|
|
|
442
442
|
/* STARDUSTLC_UPDATE_CLIENT_BODY_END */
|
|
443
443
|
})();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-voice",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.5",
|
|
4
|
+
"description": "DSH 语音工具:Edge TTS 朗读、兼容 ASR 转写、工作区文件保护与并发输出。欢迎提交 issues 和 PR。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsc -p tsconfig.json && node scripts/build-updates.mjs",
|
|
31
31
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
32
|
-
"test": "
|
|
33
|
-
"test:integration": "
|
|
34
|
-
"prepublishOnly": "
|
|
32
|
+
"test": "npm run build && node --test \"test/*.test.mjs\"",
|
|
33
|
+
"test:integration": "npm run build && node --test \"integration/*.test.mjs\"",
|
|
34
|
+
"prepublishOnly": "npm run build"
|
|
35
35
|
},
|
|
36
36
|
"dsh": {
|
|
37
37
|
"bundle": {
|