@memef1f1y/dsh-plugin-tts 0.6.2 → 0.6.3

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/README.md CHANGED
@@ -8,16 +8,20 @@
8
8
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="license"></a>
9
9
  <a href="https://github.com/awesome-dsh-plugin/awesome-dsh-plugin"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="Awesome"></a>
10
10
  <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-22%2B-blue" alt="node"></a>
11
- <a href="tests/smoke.mjs"><img src="https://img.shields.io/badge/tests-68%20passed-success" alt="tests"></a>
11
+ <a href="tests/smoke.mjs"><img src="https://img.shields.io/badge/tests-133%20passed-success" alt="tests"></a>
12
12
  <a href="https://github.com/1624318455/dsh-plugin-tts"><img src="https://img.shields.io/github/stars/1624318455/dsh-plugin-tts" alt="stars"></a>
13
13
  <a href="https://github.com/1624318455/dsh-plugin-tts/commits/main"><img src="https://img.shields.io/github/last-commit/1624318455/dsh-plugin-tts" alt="last commit"></a>
14
14
  </p>
15
15
 
16
16
  ## Links
17
17
 
18
- - **[中文 README](README.zh.md)**(简体中文)
19
- - **[RVC Custom Voice Guide](docs/RVC-GUIDE.md)** — custom voices · chunked progressive playback · compact index · voice packs · portable runtime
18
+ - **[中文 README](README.zh.md)**(简体中文,与本页逐节对应)
20
19
  - **[User Guide (执行手册)](docs/USER-GUIDE.md)** — step-by-step, for first-time users
20
+ - **[RVC Custom Voice Guide](docs/RVC-GUIDE.md)** — custom voices · chunked progressive playback · compact index · voice packs · portable runtime
21
+ - **[Index-TTS2 Guide](docs/INDEX-TTS2-GUIDE.md)** — local reference-audio voices
22
+ - **[CosyVoice Guide](docs/COSYVOICE-GUIDE.md)** — local zero-shot prompt cloning (CosyVoice-2.0-0.5B)
23
+ - **[Cloud TTS Guide](docs/CLOUD-GUIDE.md)** — paid Google voices · API key · usage & billing caliber
24
+ - **[Edge TTS Guide](docs/EDGE-GUIDE.md)** — default online reading
21
25
  - **[Adaptive chunked playback design](docs/adaptive-chunked-playback.md)** — how gapless long reads work
22
26
 
23
27
  ---
@@ -46,15 +50,22 @@ voice-pack registry**; a **portable RVC runtime** means no RVC WebUI install is
46
50
  read aloud automatically (the toggle gets a circular highlight); when off,
47
51
  nothing is auto-read.
48
52
  3. **Voice settings panel** under 设置 → 插件 → 语音:
49
- - **TTS provider**: Edge TTS (free, no API key) / custom RVC voice /
50
- local Index-TTS2 voice / local CosyVoice clone / Google Cloud TTS (paid, API key)
51
- - **Voice**: 22 live-verified Edge TTS voices (default 晓萱 zh-CN-XiaoxuanNeural);
52
- 8 Cloud voices in the cmn-CN group (default cmn-CN-Wavenet-A, free-form id allowed)
53
- - **Sound tuning**: rate / pitch / volume (0 = default, shared by Edge & Cloud)
54
- - **CosyVoice config**: service URL (default 7890) + prompt-audio picker/refresh/upload +
55
- speed (0.5–2.0) + seed (0 = random)
56
- - **Cloud config**: API Key (Host-file-only, write-only input) + Project ID (optional) +
57
- test button + this month's local usage per tier (Standard 4M / Wavenet-Neural2-Chirp3 1M)
53
+ - **TTS provider**: Edge TTS (free, no API key) / custom RVC voice /
54
+ local Index-TTS2 voice / local CosyVoice clone / Google Cloud TTS (paid, API key)
55
+ - **Voice**: 22 live-verified Edge TTS voices (default 晓萱 zh-CN-XiaoxuanNeural);
56
+ 8 Cloud voices in the cmn-CN group (default cmn-CN-Wavenet-A, free-form id allowed)
57
+ - **Sound tuning**: rate / pitch / volume (0 = default, shared by Edge & Cloud)
58
+ - **RVC config**: service URL + model (.pth) / index (.index) picker, base voice,
59
+ voice tuning and advanced params — see the [RVC Guide](docs/RVC-GUIDE.md)
60
+ - **Index-TTS2 config**: service URL (default 7880) + reference-voice
61
+ picker/refresh/upload + clean-text toggle + emotion control + sampling
62
+ params — see the [Index-TTS2 Guide](docs/INDEX-TTS2-GUIDE.md)
63
+ - **CosyVoice config**: service URL (default 7890) + prompt-audio picker/refresh/upload +
64
+ prompt transcript (required, in order and in full) + speed (0.5–2.0) + seed (0 = random) —
65
+ see the [CosyVoice Guide](docs/COSYVOICE-GUIDE.md)
66
+ - **Cloud config**: API Key (Host-file-only, write-only input) + Project ID (optional) +
67
+ test button + this month's local usage per tier (Standard 4M / Wavenet-Neural2-Chirp3 1M) —
68
+ see the [Cloud Guide](docs/CLOUD-GUIDE.md)
58
69
  - **Voice packs**: one-click install of voices from a registry
59
70
  - **Preview**: type text and press the play (triangle) button — a spinning
60
71
  loader shows while it is synthesizing/playing (click again to stop),
@@ -72,8 +83,10 @@ voice-pack registry**; a **portable RVC runtime** means no RVC WebUI install is
72
83
  tokens (`--dsw-*`); the RVC panel opens with a first-time 3-step guide
73
84
  (per-OS startup commands + one-click diagnostics).
74
85
  8. **Download audio**: a download button on each message saves the synthesized
75
- audio (Edge base or RVC-converted) as an MP3 — reuses the in-session cache so
76
- a just-read message downloads instantly.
86
+ audio — MP3 for Edge/Cloud reads, WAV for local (RVC/Index-TTS2/CosyVoice)
87
+ reads — reusing the in-session cache so a just-read message downloads
88
+ instantly. Long chunked reads have no single output file yet and report
89
+ "not supported" instead of starting a wasteful re-synthesis.
77
90
  9. **Read selected text**: selecting text in a message shows a floating
78
91
  "朗读选中" chip — click it to read just that selection.
79
92
  10. **Streaming long reads (Edge too)**: long plain-Edge reads also stream
@@ -97,21 +110,36 @@ voice-pack registry**; a **portable RVC runtime** means no RVC WebUI install is
97
110
 
98
111
  - DeepSeek Harness `web` profile (`dsh web`)
99
112
  - Node.js >= 22 (the worker uses the native `WebSocket`)
100
- - For **RVC custom voices only**: a local RVC inference environment (an RVC WebUI
101
- or the portable runtime) and a running `rvc-server.py`. macOS users: see the
102
- [RVC Guide](docs/RVC-GUIDE.md) → "启动本地 RVC 服务" and the
103
- [User Guide](docs/USER-GUIDE.md) §4.2.
113
+ - For **local-voice providers only** (nothing to install for Edge/Cloud):
114
+ - **RVC custom voices**: a local RVC inference environment (an RVC WebUI
115
+ or the portable runtime) and a running `rvc-server.py` — see the
116
+ [RVC Guide](docs/RVC-GUIDE.md) → "启动本地 RVC 服务" and the
117
+ [User Guide](docs/USER-GUIDE.md) §4.2. macOS users start there too.
118
+ - **Index-TTS2 voices**: the local `index-tts2-nvidia` bundle's API service
119
+ (`启动api服务.bat`, default port 7880) — see the
120
+ [Index-TTS2 Guide](docs/INDEX-TTS2-GUIDE.md).
121
+ - **CosyVoice clones**: the local CosyVoice-2.0-0.5B bundle's `cosy-server.py`
122
+ (`启动cosy服务.bat`, default port 7890) — see the
123
+ [CosyVoice Guide](docs/COSYVOICE-GUIDE.md).
104
124
 
105
125
  ## Install
106
126
 
127
+ Four equivalent ways (pick any one):
128
+
107
129
  ```sh
108
- # published form:
130
+ # dsh-market UI: search the market for the plugin name and install
131
+ # npm package:
132
+ dsh plugin --profile web add "@memef1f1y/dsh-plugin-tts"
133
+ # GitHub source:
109
134
  dsh plugin --profile web add "github:1624318455/dsh-plugin-tts#main"
110
135
  # or local development:
111
- dsh plugin --profile web add "file:/path/to/dsh-plugin-tts"
136
+ dsh plugin --profile web add "file:/path/to/dsh-plugin-tts/plugin"
112
137
  ```
113
138
 
114
139
  Restart `dsh web`; the plugin then loads automatically as a profile bundle.
140
+ Uninstalling any one of the above first is required before installing another:
141
+ they all register the same loader entry id (`tts`), and the installer refuses
142
+ duplicates (it rolls back instead of overwriting).
115
143
 
116
144
  ## Voices (live-verified, Edge TTS)
117
145
 
@@ -130,8 +158,8 @@ Restart `dsh web`; the plugin then loads automatically as a profile bundle.
130
158
 
131
159
  | Layer | Location | Role |
132
160
  |---|---|---|
133
- | Host | `lib/index.mjs` | Registers `/dsh-tts-api/speak` (synthesis / chunk queue), `/dsh-tts-audio/<id>` (audio), `/dsh-tts-api/rvc-*` (RVC inference / files / compact index / voice packs) webServer routes; runs a zero-dependency worker via `node -e` |
134
- | Client | `lib/client.js` | Hidden `<audio>` host in `shell.overlay` + the UI entries (read-aloud button / auto-read toggle / settings panel); talks to the Host through `fetch` |
161
+ | Host | `lib/index.mjs` | Registers webServer routes: `/dsh-tts-api/speak` (synthesis / chunk queue, all providers), `/dsh-tts-audio/<id>` (audio bytes), `/dsh-tts-api/rvc-next` (next chunk / job cancel), `/dsh-tts-api/rvc-files` + `/rvc-compact-index` + `/rvc-packs*` (RVC service proxy / packs), `/dsh-tts-api/index-*` and `/dsh-tts-api/cosy-*` (local service proxy + config), `/dsh-tts-api/cloud-*` (Cloud key/usage/test), `/dsh-tts-api/notify` (approval-alert queue), `/dsh-tts-api/diagnose` (one-click diagnostics); runs a zero-dependency Edge worker via `node -e` |
162
+ | Client | `lib/client.js` | Web Audio chunk player (sample-accurate joins, `<audio>` fallback) in `shell.overlay` + the UI entries (read-aloud button / auto-read toggle / settings panel); talks to the Host through `fetch` |
135
163
 
136
164
  The TTS worker mirrors [node-edge-tts@1.2.10](https://github.com/SchneeHertz/node-edge-tts):
137
165
  `Sec-MS-GEC` query params (ticks rounded to the 5-minute boundary),
@@ -177,11 +205,14 @@ derived from the voice locale, one retry on abnormal (1006) closures. Audio is
177
205
 
178
206
  Layered storage:
179
207
 
180
- - **Host file** (`~/.dsh/tts-rvc/settings.json`, `{ version: 1, rvc: … }`):
181
- service-class RVC config — service URL, model and index paths. Shared across
208
+ - **Host file** (`~/.dsh/tts-rvc/settings.json`,
209
+ `{ version: 1, rvc: …, index: …, cosy: …, cloud: … }`):
210
+ service-class config — RVC service URL/model/index paths, Index-TTS2 and
211
+ CosyVoice service URLs, Cloud API key (+ optional project ID). Shared across
182
212
  browsers, survives browser-data clears and incognito. Served/updated through
183
213
  `GET /dsh-tts-api/rvc-config` + `POST /dsh-tts-api/rvc-config-save`
184
- (legacy `localStorage` values migrate up once, then the file wins).
214
+ (and the matching `index-config`, `cosy-config`, `cloud-config` routes;
215
+ legacy `localStorage` values migrate up once, then the file wins).
185
216
  - **localStorage** (`dsh-tts-settings`): UI prefs only — voice, auto-read
186
217
  toggle, provider, sound tuning, the raw-Markdown toggle, approval-alert and
187
218
  remaining RVC prefs. Never stores the service URL / model / index.
@@ -227,21 +258,30 @@ portable runtime, settings reference and troubleshooting — lives in the
227
258
  | Windows (CPU-minimal) | ~1–2 GB | ~2–3 GB |
228
259
  | Windows (with NVIDIA GPU) | ~6 GB | ~7 GB |
229
260
  - These are self-contained runtimes; the **full RVC WebUI is 7.8 GB** — we don't ship the WebUI / training / realtime parts this plugin doesn't need.
261
+ - Index-TTS2 / CosyVoice also ship as local bundles (sizes vary by release — see the [Index-TTS2 Guide](docs/INDEX-TTS2-GUIDE.md) / [CosyVoice Guide](docs/COSYVOICE-GUIDE.md) preparation sections).
230
262
 
231
263
  **Q: Are the dependencies big?**
232
264
  - The runtime is heavy but **you don't install anything**: the portable package bundles Python, ffmpeg (Windows) / PyAV (macOS), and all inference deps. Unzip and run — no compile, no env setup.
233
265
  - The plugin itself has minimal deps and only loads what it actually uses.
234
266
 
235
267
  **Q: Do I need a local TTS model?**
236
- - With the default Edge TTS: **no** — it synthesizes online (free).
268
+ - With the default Edge TTS or Cloud TTS: **no** — they synthesize online.
237
269
  - With custom voices (RVC): you need **your own** RVC voice model (`.pth`), optionally a `.index`; the pretrained hubert / rmvpe are already bundled — you only provide your trained model.
270
+ - With Index-TTS2 / CosyVoice: no training needed — you provide **reference/prompt audio** (a few seconds of clear speech) to the local bundle and pick it in the panel; see the [Index-TTS2 Guide](docs/INDEX-TTS2-GUIDE.md) and [CosyVoice Guide](docs/COSYVOICE-GUIDE.md).
238
271
 
239
272
  **Q: Is it easy to install?**
240
273
  - Install the plugin normally, then for RVC: download the portable package for your platform → unzip → run the launcher (double-click `.command` on macOS, `.bat` on Windows) → drop your `.pth` into `assets/weights` → pick it in the plugin panel.
274
+ - Index-TTS2 / CosyVoice follow the same three steps (bundle → keep its service running → pick a voice in the panel); Cloud TTS only needs an API key pasted into settings. Each provider guide walks through it.
241
275
  - No compile, no manual Python/ffmpeg install. Note: **the first macOS launch is slow (tens of seconds)** while macOS scans the extracted runtimes (one-time); later launches take a few seconds.
242
276
 
243
277
  **Q: Do I need a paid API?**
244
- - No. Edge TTS is free (no API key) and RVC runs fully locally and free.
278
+ - No for Edge TTS (free, no API key) and RVC / Index-TTS2 / CosyVoice (fully
279
+ local and free — but each needs its local service package running, see
280
+ Requirements above).
281
+ - Google Cloud TTS is pay-as-you-go and needs your own API key: Chinese
282
+ Standard voices are free for the first 4M chars/month, Wavenet/Neural2/Chirp
283
+ for the first 1M chars/month (local counters; Google Cloud Billing is
284
+ authoritative). See the [Cloud Guide](docs/CLOUD-GUIDE.md).
245
285
  - Note: Edge TTS is Microsoft's public client-side, free capability — fine for personal use; check Microsoft's terms for commercial / heavy usage.
246
286
 
247
287
  **Q: Did this modify the DSH core?**