npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-voice-loop

v0.1.0

Published

DSH 语音闭环:内置语音转写完成后自动发送,并把每轮回答压成一两句用自然中文音色念出来。

Readme

dsh-voice-loop

给 DeepSeek Harness 桌面版加一条「语音闭环」:

  1. 页面侧(自动发送):内置「语音输入」把转写文字塞进草稿后,这个插件会自动点发送, 不用再按回车。右下角有个小面板可以随时开关,并显示输入框/发送键有没有被识别到。
  2. 宿主侧(朗读回复):一轮回答结束时,把 AI 正文压成开头一两句念出来, 默认约 70 字、十几秒,有「结论」段落就优先念结论。 音色默认用微软在线的 晓晓(zh-CN-XiaoxiaoNeural),比系统自带的 Huihui 自然得多; 没网时自动退回系统 SAPI 音色。

安装

dsh plugin --profile desktop add dsh-voice-loop

从本地源码安装(开发用):

dsh plugin --profile desktop add link:<本仓库目录的绝对路径>

装完 完全退出并重开 DeepSeek Harness(注入行是宿主启动时收集一次,刷新页面不够)。

依赖

  • Python 3:在线朗读需要 edge-tts,装一次即可:

    python -m pip install --user edge-tts

    没装也能用,会自动退回系统自带的 SAPI 中文音色(Microsoft Huihui Desktop),只是没那么自然。

  • 网络:engine: edge 需要联网;离线场景请改成 engine: sapi。

使用

  1. 打开侧栏「插件管理」,确认「语音输入」(蓝色声波图标)是启用的。
  2. 右下角出现「🎙 语音直发」面板,两个开关 + 一行状态:
    • 「说完自动发送」:转写完成后自动点发送;
    • 「连说(念完自动开麦)」:发送后等朗读结束,自动点麦克风开下一轮;
    • 「说完自动停」常开(要关改 autoStop: false)。
    • 状态行应显示 输入框 ✓、发送键 ✓(发送键找不到时会退回模拟回车)。
  3. 连说打开后:点一次麦克风,之后一句接一句说,中间不用再点。
  4. AI 回答结束时会自动朗读;新回答会自动打断上一段朗读。

「说完自动停」的原理:录音条出现时,页面自己再开一路只测音量的麦克风 (音频不出本机、不保存),连续静音约 0.9 秒就替你点「停止并识别」; 如果一句都没检测到,就点「取消」,避免发出空消息。

「连说」的原理:宿主在 /dsh-voice-loop/speech 暴露「是否正在朗读」, 页面在发送后轮询它——听到念完才开麦,所以不会把朗读声录进去再发回来。 如果这一轮根本没朗读(比如没网),10 秒后也会开麦;超过 45 秒放弃。

调整朗读长短(改完立刻生效,不用重启)

编辑 settings.json(本目录下),下一次朗读就按新值来:

{ "speak": true, "mode": "brief", "briefChars": 70 }

| 键 | 默认 | 说明 | |---|---|---| | speak | true | 关掉就完全不朗读 | | mode | brief | brief = 只念开头一两句;full = 念全文(截到 maxChars) | | briefChars | 70 | brief 模式的目标字数;越小越短。40 ≈ 七八秒,120 ≈ 二十几秒 | | preferConclusion | true | 优先念带「结论/总结/总之/核心/建议」等标记的段落,而不是第一段 | | includeSubagents | false | 是否也朗读子会话(子代理/子任务)的回答 | | engine | edge | edge = 在线音色(自然,需联网);sapi = 系统本地音色(离线) | | edgeVoice | zh-CN-XiaoxiaoNeural | 在线音色,候选见下 | | edgeRate | +0% | 在线语速,-10% 更慢、+20% 更快 | | maxChars | 1200 | full 模式的最大字数 | | autoSend | true | 转写完成后自动发送(面板开关的默认值) | | autoStop | true | 静音自动点「停止并识别」,常开 | | autoReopen | true | 连说:朗读结束后自动开麦(面板开关的默认值) |

可选的在线音色(改 edgeVoice,下一次朗读就生效)

| 值 | 音色 | |---|---| | zh-CN-XiaoxiaoNeural | 晓晓,女声,温柔自然(默认) | | zh-CN-XiaoyiNeural | 晓伊,女声,年轻 | | zh-CN-YunxiNeural | 云希,男声,年轻 | | zh-CN-YunjianNeural | 云健,男声,浑厚 | | zh-CN-YunyangNeural | 云扬,男声,新闻播报感 | | zh-CN-liaoning-XiaobeiNeural | 晓北,东北话 | | zh-CN-shaanxi-XiaoniNeural | 晓妮,陕西话 | | zh-TW-HsiaoChenNeural | 曉臻,台湾国语 | | zh-HK-HiuMaanNeural | 曉曼,粤语 |

voice(SAPI 语音名)和 rate(SAPI 语速 -10..10)在 cordis.patch.yml 里, 只在 engine: sapi 或在线合成失败回退时用到,改这两个需要重启应用。

段落的选法:先找开头带「结论 / 总结 / 总之 / 核心 / 要点 / 建议 / 一句话」等标记的段落; 没有就取第一段有实义的正文。

遇到「主要延迟来自三部分:」这种导语句 + 列表时抓重点:只取每项的加粗词 (没有加粗就取冒号前的短语),串成一句,例如 是。主要延迟来自三部分:在线合成、进程冷启动、整段合成。 只有一条要点都抓不到时,才退回把列表念完。

跳过标题、代码块、表格;句子太长时退到最近的逗号,不把半句话掐断。

自动发送的开关状态存在页面 localStorage(dsh-voice-loop.auto)。

已知限制

  • 自动发送靠「成段文字 + 最近 1.2 秒内没有真人键盘输入」判断是不是语音转写, 所以极快的粘贴也可能被当成语音;面板上关掉开关即可。
  • 在线朗读(engine: edge)会把要念的那句话发给微软的朗读服务;不想外发就改 engine: sapi。
  • 在线合成需要联网并已安装依赖:python -m pip install --user edge-tts。合成失败会自动回退到系统语音。
  • 朗读只对主会话生效;子代理/子任务的会话默认不念(includeSubagents: true 可打开)。