dsh-voice 0.6.1 → 0.7.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/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Voice",
4
- "description": "Keyless Edge neural text-to-speech (TTS), short voice previews, and OpenAI/Groq-compatible speech-to-text (STT) within workspace boundaries."
4
+ "description": "Keyless Edge & OpenAI-compatible text-to-speech (TTS) with long-text/Markdown cleanup, multi-speaker podcasts, SRT/VTT subtitle export, interactive voice previews, and Groq/OpenAI/SiliconFlow/local Whisper speech-to-text (STT) inside the workspace."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "语音",
4
- "description": "零密钥 Edge 神经网络语音合成(TTS)、短试听音色预览与 OpenAI/Groq 兼容语音转文字(STT)。"
4
+ "description": "零密钥 Edge / OpenAI 兼容语音合成(TTS)、长文本与 Markdown 清理、多角色播客、SRT/VTT 字幕导出、网页试听页与 Groq/OpenAI/SiliconFlow/本地 Whisper 语音转文字(STT)。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-voice",
3
- "version": "0.6.1",
4
- "description": "DeepSeek Harness 语音插件:零密钥 Edge TTS 朗读、音色试听、兼容 ASR 转写与工作区输出保护。欢迎提交 issues 和 PR。",
3
+ "version": "0.7.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,78 @@
1
+ ---
2
+ name: voice-workflow
3
+ description: Best-practice workflows for dsh-voice: direct file TTS with Markdown cleanup, oral script adaptation, multi-speaker podcast segments, SRT/VTT subtitle export, interactive voice auditions, and large-recording transcription. Load when turning documents/notes into speech, producing podcasts/subtitles, 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, or transcribing recordings inside the active session workspace.
9
+
10
+ ## 1. Pick Voices & Audition Before Long Renders
11
+
12
+ - Discover voices with `voice_list({ locale, gender, tag })` instead of guessing IDs. Useful tags include `podcast`, `multilingual`, `warm`, `news`, `dialect`.
13
+ - Flagship multilingual options:
14
+ - Chinese + English bilingual: `zh-CN-XiaoxiaoMultilingualNeural`, `zh-CN-YunyiMultilingualNeural`, `zh-CN-YunfanMultilingualNeural`
15
+ - English multilingual: `en-US-AvaMultilingualNeural`, `en-US-AndrewMultilingualNeural`, `en-US-EmmaMultilingualNeural`
16
+ - When the user wants to compare voices, call `voice_preview({ voices: [...], text })`. It writes MP3 samples and an interactive `voice_previews/index.html` browser audition page (with playback speed toggles and one-click voice ID copy).
17
+
18
+ ## 2. Direct File Synthesis & Markdown Cleanup (`inputFile`)
19
+
20
+ - **Do not copy large `.md` or `.txt` files into `text` arguments.** Pass `inputFile` directly to `voice_tts`:
21
+ ```json
22
+ {
23
+ "inputFile": "docs/article.md",
24
+ "output": "article.mp3"
25
+ }
26
+ ```
27
+ - `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.
28
+ - 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.
29
+
30
+ ## 3. Oral Script Adaptation for Briefings
31
+
32
+ When the user asks to summarize notes, changelogs, or reports into a spoken briefing rather than reading a file verbatim:
33
+
34
+ - Rewrite bullet lists, Markdown tables, code identifiers, and bare URLs into natural spoken sentences before calling `voice_tts`.
35
+ - Spell out or paraphrase abbreviations and symbols (e.g., turn `->`, `>=`, or file paths into natural transitions) so the narration sounds like a human host.
36
+ - Keep target duration in mind (roughly 220–260 Chinese characters or 130–160 English words per minute at `+0%` rate).
37
+
38
+ ## 4. Multi-Speaker Podcasts (`segments`)
39
+
40
+ Produce two-host or multi-role dialogues in a single MP3 using `voice_tts` `segments` (up to 50 segments per call):
41
+
42
+ ```json
43
+ {
44
+ "segments": [
45
+ {
46
+ "voice": "zh-CN-XiaoxiaoMultilingualNeural",
47
+ "text": "欢迎收听本期技术早报,今天我们来聊聊最新的语音工作流。",
48
+ "pauseMs": 350
49
+ },
50
+ {
51
+ "voice": "zh-CN-YunyiMultilingualNeural",
52
+ "text": "没错,现在长文稿和双人播客都可以一次合成,还能同步导出字幕。",
53
+ "rate": "+5%",
54
+ "pauseMs": 300
55
+ }
56
+ ],
57
+ "output": "podcast.mp3",
58
+ "subtitleOutput": "podcast.srt"
59
+ }
60
+ ```
61
+
62
+ - Each segment supports optional `voice`, `rate`, `pitch`, and `pauseMs` (default inter-segment silence `300` ms).
63
+ - Pair contrasting voices (for example `zh-CN-XiaoxiaoMultilingualNeural` + `zh-CN-YunyiMultilingualNeural`, or `en-US-AvaMultilingualNeural` + `en-US-AndrewMultilingualNeural`) for natural turn-taking.
64
+
65
+ ## 5. Synchronized Subtitles for Video Pipelines (`subtitleOutput`)
66
+
67
+ - 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.
68
+ - Pass `subtitleOutput: "transcript.srt"` (or `.vtt`) to `voice_stt` to automatically request word/segment timestamps and write subtitles alongside the transcript.
69
+ - Hand the resulting `.mp3` and `.srt`/`.vtt` files directly to `dsh-ffmpeg` for subtitle burn-in or `dsh-remotion` for timeline composition.
70
+
71
+ ## 6. Meeting Transcription & Health Checks
72
+
73
+ - **Domain accuracy**: Pass project names, acronyms, and speaker terms in `voice_stt({ audio, prompt: "DeepSeek Harness, Cordis, ...", output: "meeting.txt" })`.
74
+ - **Large recordings (>25 MB)**: Pass `autoCompress: true` to `voice_stt`. When local `ffmpeg` is available, `dsh-voice` automatically transcodes (16kHz mono) and splits recordings longer/larger than 24 MB into segments, merges the transcript, and shifts subtitle timestamps accurately.
75
+ - **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.
76
+ - **Scoped diagnostics**:
77
+ - Run `voice_health({ scope: "tts" })` before TTS-only tasks so an unconfigured ASR key does not trigger false alarms.
78
+ - 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.