feat(tts): serve Piper voice model from voice.shadow.wang CDN - #39
Merged
Conversation
- 语音模型改由 CDN(voice.shadow.wang)首次下载,浏览器缓存后可离线使用 - CSP connect-src 增加 voice.shadow.wang - 移除本地分片模型与 worker runtime 选择,本地推理在主线程执行 - 更新单元测试与语音相关 e2e 断言
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Aug 15, 2026
WardLu
added a commit
that referenced
this pull request
Aug 15, 2026
- 移除 v1.3.7 遗留的本地 en_US-lessac-high 分片模型(约 115MB)与 Worker 运行时文件 (PR #39 已切换 voice.shadow.wang CDN + 主线程推理,不再使用) - 同步 release-gate.config.json、scripts/check.mjs、scripts/security-check.mjs、 THIRD_PARTY_NOTICES.md、piper-dev-server e2e 与 public/sw.js 中的引用 - 已通过 npm run verify、release:check 与语音相关 e2e(33 项)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
v1.3.7 的离线英语语音把
en_US-lessac-high模型(约 115MB,分片)随包打进public/。本次将语音模型托管迁移到voice.shadow.wangCDN(en_US-ljspeech-medium,约 63.5MB),首次下载后缓存进浏览器,可离线合成,不上传录音。CDN 侧 CORS 已配置并实测通过。改动(6 个文件,仅语音 CDN/CORS 相关)
src/piper-tts.js:VOICE指向https://voice.shadow.wang/piper/en_US-ljspeech-medium;移除本地分片拼接与 worker runtime 选择(本地推理在主线程执行);下载进度依赖响应Content-Length。vercel.json:CSPconnect-src增加https://voice.shadow.wang(线上 CSP 需随本次部署更新,否则仍会拦截 CDN 请求)。scripts/check.mjs:语音路径发布门槛检查改为 CDN URL。tests/unit/piper-tts.test.js、tests/e2e/offline-tts-error.spec.js、tests/e2e/offline-tts-warmup.spec.js:同步 CDN 路径与主线程 runtime 断言。验证
npm run verify全绿(public/security 检查 + 构建 + check-build + 72 个单元测试)。offline-tts-warmup5 个、offline25 个、offline-tts-error+tts-system-fallback2 个。Access-Control-Allow-Origin: https://sm.shadow.wang、Allow-Methods: GET, HEAD, OPTIONS、Expose-Headers: Content-Length, Content-Range, ...;真实浏览器从https://sm.shadow.wang跨域 fetch:.onnx.json200type: cors、.onnxRange 206content-range: bytes 0-1023/63531379。注意事项(有意保持最小改动,未纳入本 PR)
public/piper/en_US-lessac-high.onnx.part-*(约 115MB)与public/worker/*仍保留在仓库/构建产物中但不再被引用,建议后续单独 PR 清理。sm.shadow.wang响应头 CSP 含voice.shadow.wang;触发一次语音下载确认 CDN 拉取成功。