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-asr

v0.1.0

Published

Local speech-to-text for DSH: SILK v3 (QQ/WeChat voice) → text with Whisper ONNX; audio never leaves the machine.

Readme

dsh-voice-asr

给 DeepSeek Harness 的本地语音转文字插件:把 QQ/微信语音(SILK v3)或任意 SILK 语音文件转成文字, 音频不出本机,只有模型文件需要联网下载一次(默认走 hf-mirror.com)。

Local speech-to-text plugin for DSH. It decodes SILK v3 voice (what QQ/WeChat actually use, even when the file is named .amr) and transcribes it with Whisper ONNX on CPU. Audio never leaves the machine.

它能做什么

注册 3 个 AI 工具:

| 工具 | 作用 | | --- | --- | | voice_asr_transcribe | 转写一段语音:path(本机文件)或 base64 二选一,可覆盖 model / language | | voice_asr_status | 查看模型配置、缓存是否就绪 | | voice_asr_warmup | 预加载模型(首次安装后跑一次,之后转写更快) |

适合的场景:

  • 让 agent「听懂」QQ/微信语音文件(例如配合 qq-bridge 的入站语音);
  • 把语音素材批量转成文字(工具调用里逐条传 path);
  • 离线/隐私敏感场景:不调用任何云端 ASR API。

安装

从插件市场(已上架时)

插件页 → 发现 → 搜索 dsh-voice-asr → 安装。安装依赖会自动完成(约 150–300MB,含 onnxruntime)。

从本地目录安装(开发/自用)

# 1) 把本包放进 DSH 的插件目录(或任意稳定路径)
cp -R dsh-voice-asr ~/.dsh/plugins/dsh-voice-asr

# 2) 在 profile 里加 link 依赖,并把 bundle 加进 bundles 列表
#    ~/.dsh/profiles/desktop/package.json
#      "dependencies": { "dsh-voice-asr": "link:/Users/<you>/.dsh/plugins/dsh-voice-asr" }
#      "dsh": { "profile": { "bundles": [ ..., "dsh-voice-asr" ] } }

# 3) 安装依赖并让 DSH 重新加载
cd ~/.dsh/profiles/desktop && pnpm install
# 重启 DSH(或等 HMR 热加载 bundle 变更)

使用

安装后直接对 AI 说:

  • 「用 voice_asr_warmup 预热一下语音模型」
  • 「把 /path/to/voice.amr 转成文字」(它会调用 voice_asr_transcribe,path 传该文件)

path 只接受语音扩展名(.silk/.slk/.amr/.aud/.ptt/.bin)并限制 40MB,不会读取任意本地文件。 音频内容必须是 SILK v3(QQ/微信语音就是);WAV/MP3 需要先转成 SILK。

模型与配置

| 配置 | 默认 | 说明 | | --- | --- | --- | | model | Xenova/whisper-base | 更小 Xenova/whisper-tiny,更准 Xenova/whisper-small(更大更慢) | | remoteHost | https://hf-mirror.com | HuggingFace 直连不通时用镜像;能直连可改成 https://huggingface.co | | cacheDir | $DSH_HOME/voice-asr/models | 模型缓存目录(下载一次后离线可用) | | language | zh | 识别语言 | | toSimplified | true | Whisper 常输出繁体,自动转简体(opencc) | | timeoutMs | 300000 | 单条转写超时 |

配置方式(优先级从高到低):工具参数 > 插件配置 > 环境变量 > 默认值。

环境变量:DSH_VOICE_ASR_MODEL / DSH_VOICE_ASR_REMOTE_HOST / DSH_VOICE_ASR_CACHE_DIR / DSH_VOICE_ASR_LANGUAGE / DSH_VOICE_ASR_TO_SIMPLIFIED=0。

首次调用 voice_asr_transcribe 会下载模型(whisper-base 约 300MB),期间可能看起来卡住; 可以先跑 voice_asr_warmup 并给它足够时间(默认 10 分钟超时)。

隐私

  • 音频只在本机内存/磁盘处理,不会上传到任何服务器;
  • 唯一联网动作是从模型源下载 ONNX 模型文件;
  • 转写结果缓存在 $DSH_HOME/voice-asr/transcripts.json(按音频内容 sha256 去重)。

已知限制

  • 只支持 SILK v3(QQ/微信语音的实际编码);真 AMR/WAV/MP3 暂不支持(可用 ffmpeg 等先转码再改扩展名,本插件按文件头判断)。
  • Whisper base 对中文短语音/口音会有个别字错误,属于模型能力上限;要更准换 whisper-small。
  • 首次模型下载依赖网络与镜像可用性;下载失败会报错并保留缓存目录,可重试。
  • 纯音乐/环境音会转成噪声文字。

附带:qq-bridge 入站语音自动转写补丁

bridge-patch/ 里带了一份可选补丁,给 qq-bridge 接上同一套本地 Whisper:QQ 收到的语音条会先转成文字, 再带「(语音转文字,可能有误:…)」一起交给模型。

node bridge-patch/apply.mjs /path/to/qq-bridge            # 打补丁 + 装依赖
node bridge-patch/apply.mjs /path/to/qq-bridge --dry-run   # 只看会改什么

补丁是幂等的(已打过会直接跳过),会自动备份 src/bridge.js 与 config.json;重启桥接生效。 详见 bridge-patch/README.md。

开发

npm install
node scripts/selftest.mjs /path/to/sample.silk   # 用真实 SILK 语音自测
npm pack --dry-run                                # 检查发布内容

License

MIT