Reads every finished reply aloud from the chat row: a speaker button on the newest answer with a jump arrow to reach it, Edge neural voices by default, plus DeepSeek official TTS, offline sherpa-onnx Kokoro, macOS say, Windows SAPI and any OpenAI-compatible endpoint. Skips code blocks and tables, speaks long replies sentence by sentence, speed 0.5x-2.5x, with a settings panel that can also open a new session to change the plugin. The default engine needs no extra install besides a network connection.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-readaloud-plus
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Frey-Good/dsh-readaloud
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
让 DSH 用自然人声把每条回答念出来。
- 每条回答一个喇叭:鼠标移到已完成的回答上,操作栏里(复制、赞、踩、分支之后)出现 🔊,点一下念,再点停止。
- ⌃ 打开设置:喇叭右边的小箭头(只在最新那条回答上出现)打开设置面板;面板是毛玻璃,点外面或按 Esc 收起。
- 自动朗读:面板第一行。打开后每条新回答写完就自动念;正在念的时候来了新回答,直接切到新的,不会排队念旧的。
- 语速滑杆 0.5×–2.5×,拖了立刻作用在正在念的这一句上(合成始终按自然人声做,倍速只作用在播放)。
- 代码块和表格默认跳过,在「更多设置」里可以单独打开。
- 面板底部两行提示词:添加模型(接一个新的语音引擎)、没声音时排查。点右侧「开新会话设置」=开一个新会话,提示词已经填在输入框里,按 ⏎ 就会让 DSH 自己动手。
面板结构(从上到下):自动朗读 → 引擎 → 音色 → 试听 → 语速 → 更多设置(读代码块 / 读表格 / 添加模型 / 没声音时排查)。
装
# 装了 dsh 命令行才用这个:参数原样转给 profile 目录里的 pnpm
dsh plugin --profile desktop add dsh-readaloud-plus # 从 npm
dsh plugin --profile desktop add git+https://github.com/Frey-Good/dsh-readaloud.git # 从 GitHub(同一份源码)
桌面版没有命令行也行:插件 页 → 添加插件,贴下面任意一条都行:
dsh-readaloud-plus
git+https://github.com/Frey-Good/dsh-readaloud.git
https://github.com/Frey-Good/dsh-readaloud/releases/download/v1.5.1/dsh-readaloud-plus-1.5.1.tgz
(「添加插件」认 npm 包名、Git 地址、远程 tgz、本地目录,四条路装出来是同一份。)
装完重启 DSH(或在插件页刷新),回答操作栏里就有喇叭了。
默认的微软在线音色是纯 Node 实现:不需要 Python,不需要 pip install,也不需要任何 key。只要有网。
声音从哪来、免费吗
| 引擎 | 声音来源 | 费用 | 联网 | 需要什么 |
|---|---|---|---|---|
edge(默认) |
微软 Edge「大声朗读」用的在线神经网络语音(晓晓、云希…),走 speech.platform.bing.com |
免费,不要 key、不计费 | 要 | 什么都不用装 |
deepseek |
DeepSeek 官方 TTS(POST /v1/tools/tts,音色 stella / tide) |
按字符计费,约 1.5 元/万字符(限时五折) | 要 | DEEPSEEK_API_KEY(~/.dsh/.credentials.yaml 里通常已有) |
sherpa |
本地 sherpa-onnx 上的 Kokoro 模型(完全离线,CPU 即可) | 免费 | 不要 | python -m pip install sherpa-onnx + 一份 Kokoro 模型目录 |
windows-sapi |
Windows 自带 SAPI 语音(Huihui / Kangkang…) | 免费 | 不要 | Windows + PowerShell |
macos-say |
macOS 自带 say 与系统语音包 |
免费 | 不要 | 一台 Mac(未实测,见下) |
openai |
任何兼容 POST {baseUrl}/audio/speech 的服务:OpenAI、Azure、Kokoro、GPT-SoVITS、硅基流动、自建服务 |
看服务商 | 要 | 自己的 key / 地址 |
关于 Edge 这条要说实话:它没有官方 API,用的是 Edge 浏览器朗读功能的同一个签名 websocket 接口。签名(Sec-MS-GEC)和 websocket 客户端都是本插件自己实现的(providers/edge-token.js、providers/edge-ws.js,零依赖,签名算法逐位对照过 edge-tts 的实现)。所以它免费、不用注册,但属于非官方通道——微软可以随时改接口,也可能因为请求过多返回 403。这也是做成多引擎的原因:Edge 挂了还能换别的。
配置另外两个引擎
前四个引擎自动探测;sherpa 和 openai 需要路径或 key,写在 ~/.dsh/readaloud.json(也可以走环境变量):
{
"openai": {
"baseUrl": "https://api.openai.com/v1",
"apiKey": "sk-...",
"model": "tts-1",
"format": "mp3",
"voices": [{ "id": "nova", "label": "Nova", "hint": "女声" }]
},
"sherpa": {
"modelDir": "C:/models/kokoro-zh"
}
}
openai走 OpenAI 的/audio/speech协议,baseUrl结尾的/v1要带上。sherpa的模型目录里要有model.onnx + voices.bin + tokens.txt(Kokoro 那一套)。- 环境变量优先:
DSH_READALOUD_TTS_BASE_URL/_API_KEY/_MODEL/_FORMAT。 - 改完刷新页面即可。哪个引擎不可用,面板里不会出现它。
已知限制
macos-say没在真 Mac 上跑过:代码按 macOS 的say写的,但作者手上没有 Mac。macOS 用户如果它不可用,用edge或openai。- Kokoro 不随插件分发:模型要自己准备(Hugging Face 上的 Kokoro ONNX),插件只负责读你给的目录。
- DeepSeek 官方 TTS 计费:默认不会选它,需要自己切;分句太多时会产生多次请求。
- 朗读长回答时第一句要等合成,之后边播边合成。
隐私与安全
- 朗读时只有正文发往当前选中的引擎。选
windows-sapi/macos-say/sherpa就完全不出本机;选edge/deepseek/openai就发往对应服务。不朗读时不发送。 - 音频缓存在系统临时目录
dsh-readaloud-cache(按sha256(引擎|音色|文本)命名),超过 240 个清最旧的,可随时整目录删除。 - 插件不收集任何统计信息,不上报日志,不读写插件目录以外的文件(除了上面这个缓存目录)。
- Host 侧的 HTTP 路由只接受 DSH 自己的同源会话(走
connection.admit,别的网站打不进来),只允许GET/HEAD,没有能执行外部命令或写入任意路径的接口。 - 设置存在浏览器
localStorage(dsh-readaloud/settings/v1),不含任何密钥。
English
dsh-readaloud adds a read-aloud speaker to every finished DSH reply. Click 🔊 to read, click again to stop. The ⌃ arrow next to it (newest reply only) opens a glass panel with: auto-read switch, engine, voice, a preview line, speed 0.5×–2.5× (applied to the sentence that is playing), and 更多设置 with code-block / table toggles. Two footer rows hand DSH a ready-made prompt in a new session (add an engine, debug a silent engine).
Engines: edge (default, Edge's neural voices, pure Node — no Python, free, unofficial), deepseek (official TTS, metered), sherpa (offline Kokoro, needs local models), windows-sapi (offline), macos-say (untested — no Mac available), openai (any OpenAI-compatible /audio/speech).
Install with dsh plugin --profile desktop add dsh-readaloud-plus (npm), or … add git+https://github.com/Frey-Good/dsh-readaloud.git, or Plugins → Add plugin in the Desktop app. The default engine needs nothing else — no Python, no key. UI settings live in the browser's localStorage (dsh-readaloud/settings/v1); engine settings — the sherpa model directory, an OpenAI-compatible base URL and key — live in ~/.dsh/readaloud.json or environment variables, and the DeepSeek key comes from ~/.dsh/.credentials.yaml. Only the reply text is sent, and only to the engine you picked; audio is cached under the system temp dir and nothing is logged or collected.
实现
index.js:Host 半。GET /dsh-readaloud/speak?text=&voice=&provider=(返回音频,支持 Range)、GET /providers(引擎清单 + 可用性 + 音色)、GET /status、GET /warm(提前把引擎热起来)。按sha256(provider|voice|text)缓存,先写.part再原子改名,同一句话的并发请求只合成一次。providers/:引擎层,一个引擎一个文件,接口是probe / voices / resolveVoice / synthesize。加引擎 = 加一个文件 +providers/index.js里一行。edge-native.js+edge-token.js+edge-ws.js:纯 Node 直连微软的朗读 websocket。edge-token.js按位移植了Sec-MS-GECv2 签名(对照edge-tts逐条验证过),edge-ws.js是 200 行的最小 WebSocket 客户端(Node 自带的WebSocket不能带自定义请求头,握手必须自己来)。连接复用,第二句起约 0.4 秒出声。deepseek.js:官方 TTS,流式 WAV 要重写 RIFF/data 长度,多段再拼起来。sherpa.js+sherpa_worker.py:常驻进程跑 sherpa-onnx Kokoro(24 kHz),首句等模型加载 1–3 秒。windows-sapi.js:PowerShell +System.Speech,文本写临时文件再读,绕开引号和编码。macos-say.js:say -v ?列语音,say -o … --file-format=WAVE出 16-bit PCM。openai.js:兼容接口。
client.js:一个 slot 入口(conversation.chat.assistant-actions)+ 播放引擎。把喇叭插到分支按钮之后、时间之前(用 portal 挂到操作栏里),文本从 Chat 快照取回复块(按快照缓存),Markdown 清洗 → 按句子切片 → 逐段fetch播放并预取下一段。
Links
More in this category
Yuuyuko-uu/dsh-tts-bridge★ 271
Reads DSH conversations aloud using the DeepSeek web page's built-in read-aloud, driven by a small browser extension.
Fishsb/dsh-voice-prompt-enhancer★ 137
Rewrites a composer draft into a clearer, structured prompt (5 modes, model fallback chain, optional multi-round memory) and adds stop-on-silence, hotkey and filler-word cleanup to DSH voice input; transcription stays with the official speechToText, the plugin ships no engine.
cloudoyx/any-audio★ 77
DSH has its own audio workstation too: real recordings, multiple TTS engines, genuine sound effects and local singing synthesis, with every generated sound landing as its own clip on one visible timeline that you can audition, balance and fine-tune track by track. Use it for scoring animation, producing audiobooks and radio drama, composing and mixing on your own, making ASMR, and whatever else you come up with.
PolinniZhong/dsh-omi-voice★ 75
In-chat read-aloud for DeepSeek Harness: tap to read, pause and resume AI replies with natural Doubao TTS voices (BYOK), reading only the final answer with code, tables and diagrams filtered; local engine, plugin keeps no API key.
ppy-web/dsh-plugin-xiaomi-mimo-tts★ 75
Voice Studio for DSH with 10+ cloud and local speech engines (Xiaomi MiMo, Doubao, Breeze, DeepSeek, local MOSS-Nano, browser speech, external adapters) plus cloud ASR, smart text filtering, live subtitles and voice orbs, /director multi-role WAV drama studio, and desktop pet, novel, QQ Bot, dsh-Go, and AI Passport integrations. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
1624318455/dsh-plugin-tts★ 66
Reads assistant replies aloud via free Edge TTS or your own RVC voice models: read-aloud buttons + auto-read, adaptive chunked progressive playback (gapless long reads), one-click voice-pack installs from a registry, and a portable RVC runtime.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.