dsh-gsv-tts 5.0.1 → 5.2.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/CHANGELOG_EN.md +27 -0
  3. package/README.md +291 -279
  4. package/README_EN.md +291 -279
  5. package/docs/voices.json +18 -1
  6. package/lib/audio-store.d.ts +3 -0
  7. package/lib/audio-store.d.ts.map +1 -1
  8. package/lib/audio-store.js +53 -8
  9. package/lib/audio-store.js.map +1 -1
  10. package/lib/client.js +469 -23
  11. package/lib/config.d.ts +5 -0
  12. package/lib/config.d.ts.map +1 -1
  13. package/lib/config.js +11 -0
  14. package/lib/config.js.map +1 -1
  15. package/lib/engine-manager.js +2 -2
  16. package/lib/engine-manager.js.map +1 -1
  17. package/lib/index.d.ts.map +1 -1
  18. package/lib/index.js +370 -38
  19. package/lib/index.js.map +1 -1
  20. package/lib/providers/edge.d.ts +15 -2
  21. package/lib/providers/edge.d.ts.map +1 -1
  22. package/lib/providers/edge.js +28 -3
  23. package/lib/providers/edge.js.map +1 -1
  24. package/lib/providers/gsv.d.ts +5 -1
  25. package/lib/providers/gsv.d.ts.map +1 -1
  26. package/lib/providers/gsv.js +28 -5
  27. package/lib/providers/gsv.js.map +1 -1
  28. package/lib/segmenter.d.ts +1 -1
  29. package/lib/segmenter.d.ts.map +1 -1
  30. package/lib/segmenter.js +30 -1
  31. package/lib/segmenter.js.map +1 -1
  32. package/lib/text-cleaner.d.ts +4 -2
  33. package/lib/text-cleaner.d.ts.map +1 -1
  34. package/lib/text-cleaner.js +4 -2
  35. package/lib/text-cleaner.js.map +1 -1
  36. package/lib/tts.service.d.ts +33 -0
  37. package/lib/tts.service.d.ts.map +1 -1
  38. package/lib/tts.service.js +97 -4
  39. package/lib/tts.service.js.map +1 -1
  40. package/lib/types.d.ts +2 -0
  41. package/lib/types.d.ts.map +1 -1
  42. package/lib/wav-stream.d.ts +11 -0
  43. package/lib/wav-stream.d.ts.map +1 -0
  44. package/lib/wav-stream.js +37 -0
  45. package/lib/wav-stream.js.map +1 -0
  46. package/package.json +90 -89
  47. package/scripts/dsh_stream_api.py +68 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  本文件记录 dsh-gsv-tts 的所有版本更新。格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [5.2.0] - 2026-11-10
6
+
7
+ ### Edge 在线端点
8
+ - Edge 合成迁移到 `api.msedgeservices.com`(改用 `node-edge-tts`),修复旧 `speech.platform.bing.com` 端点 403 / 握手一直挂起的问题
9
+ - Edge 音色列表仍由 `edge-tts-universal` 提供;健康检查恢复可用
10
+
11
+ ### 整段播放 / 下载 + 选中朗读
12
+ - 新增「整段」按钮:按当前回复/选中文字生成完整 WAV,可拖动进度、下载;默认流式朗读不变,首音不受影响
13
+ - 新增选中文字朗读:选中对话正文后浮出「朗读选中」,走流式 `/speak`(支持 `text` 入参)
14
+ - `AudioStore` 支持 HTTP Range / HEAD,完整音频可 seek
15
+ - 本地整段音频用流式 PCM 直接写 WAV,不设 30 秒超时;长回复不会再被截断
16
+ - 整段生成支持取消(停止/关闭页面即中断)
17
+ - Edge 整段返回可用的 `duration`(24 kHz / 48 kbps CBR 按字节换算),并把 AbortSignal 传入在途分段
18
+
19
+ ## [5.1.0] - 2026-11-06
20
+
21
+ ### 首音性能优化(GSV 本地)
22
+ - **朗读改为流式 WAV**:引擎首块到达即开始播放,不再等整条回复全部分段合成完;长回复首音明显更快(常驻模式较快;节能模式首次需加载,较慢)
23
+ - **推理预热**:引擎启动后先跑一次极短推理,避免第一次真实请求额外等待 CUDA/惰性初始化
24
+ - **新增 `/warmup` 音色预热**:缓存 speaker/prompt 特征并跑一次短推理;插件在引擎就绪后自动预热默认音色,首次使用不再重复付特征计算
25
+ - **新增引擎启动方式 `engineMode`**:**常驻模式(性能优先)** 插件加载后自动启动并预热,**节能模式(资源优先,默认)** 不后台启动(与旧版一致);常驻约 0.9GB 显存 + 0.5GB 内存
26
+ - **分段策略调整**:首段 ≤30 字、后续段 ≤150 字(JSON/NDJSON 回退路径),降低单段 30 秒超时风险
27
+ - **取消联动**:浏览器停止/切歌/关页时中断引擎请求,避免旧任务占用推理锁
28
+ - 引擎就绪轮询从 3 秒降到 0.5 秒,启动等待上限 90 秒提高到 120 秒
29
+ - 新增 `src/wav-stream.ts`(未知长度 WAV 头、float32→16-bit PCM)及单元测试
30
+ - 修复切换「在线 / 本地」模式时音色列表未按目标 provider 获取的问题(切到在线曾可能带入本地音色名)
31
+
5
32
  ## [5.0.1] - 2026-10-29
6
33
 
7
34
  ### 音色市场投稿指南
package/CHANGELOG_EN.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  All notable changes to dsh-gsv-tts are documented in this file. Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## [5.2.0] - 2026-11-10
6
+
7
+ ### Edge online endpoint
8
+ - Edge synthesis now uses `api.msedgeservices.com` via `node-edge-tts`, fixing the old `speech.platform.bing.com` 403 / hanging handshake
9
+ - Edge voice list still comes from `edge-tts-universal`; health check is available again
10
+
11
+ ### Full audio / download + read selection
12
+ - New "Full" player action: generates a complete WAV for the current reply or selected text, with seek and download; normal read-aloud still streams, so first audio is unchanged
13
+ - Read selected text from the chat with a floating "Read selection" button; it uses streaming `/speak` (`text` input)
14
+ - `AudioStore` supports HTTP Range / HEAD for seekable complete audio
15
+ - Local full audio is streamed straight into a WAV file with no 30 s timeout, so long replies are no longer cut off
16
+ - Full-audio generation can be cancelled by stop / closing the page
17
+ - Edge full audio now returns a usable `duration` (24 kHz / 48 kbps CBR from bytes) and passes AbortSignal into the in-flight segment
18
+
19
+ ## [5.1.0] - 2026-11-06
20
+
21
+ ### Faster first audio (local GSV)
22
+ - **Read-aloud now uses a streaming WAV**: playback starts as soon as the engine emits its first chunk, instead of waiting for the whole reply to be segmented and synthesized; first audio on long replies is much faster (Always-on: faster; Eco: slower on the first use because the model loads)
23
+ - **Inference warm-up** after engine start avoids the extra CUDA/lazy-init cost on the first real request
24
+ - **New `/warmup` endpoint**: caches speaker/prompt features and runs a short inference; the plugin pre-warms the default voice once the engine is ready
25
+ - **New `engineMode` setting**: **Always-on (performance)** auto-starts and pre-warms on plugin load; **Eco (resources first, default)** does not run in the background (same as before). Always-on holds ~0.9 GB VRAM + 0.5 GB RAM
26
+ - **Segment sizing**: first segment ≤30 chars, later segments ≤150 chars (JSON/NDJSON fallback path) to avoid the 30 s per-segment timeout
27
+ - **Cancellation propagation**: stopping/switching/closing the page aborts the engine request so old work no longer holds the inference lock
28
+ - Engine readiness polling reduced from 3 s to 0.5 s; startup wait raised from 90 s to 120 s
29
+ - Added `src/wav-stream.ts` (unknown-length WAV header, float32→16-bit PCM) with unit tests
30
+ - Fixed mode switching so the voice list is fetched for the requested provider (switching to Edge could previously prefill local voice names)
31
+
5
32
  ## [5.0.1] - 2026-10-29
6
33
 
7
34
  ### Voice market submission guide