tangbut1/dsh-plugin-voice-input
tangbut1★ 0TypeScript最后同步: 2026-08-14
DeepSeek Harness Web 语音输入插件
README 摘要
dsh-plugin-voice-input DeepSeek Harness Web 语音输入插件:在输入框发送键同一行、靠发送键左侧加一个「按住说话」麦克风按钮。松手后语音在 本机离线 转成文字并追加到当前草稿, 不自动发送 。模型免费、离线,中文/英文/中英夹杂(以及日/韩/粤)均可识别。 Voice input plugin for the DeepSeek Harness Web UI: hold the mic button next to the send key to talk; on release the audio is transcribed by a local offline ASR engine and appended to the draft. It never auto-sends. Free, offline, zh/en mixed supported. 架构 双端插件(一个包,两个半边): 半边 位置 职责 主机 half src/index.ts → lib/index.js 极简 HTTP 服务, 只监听 127.0.0.1:18765 ;sherpa-onnx + SenseVoice-Small INT8 离线识别;模型缺失时自动下载 浏览器 half src/client/index.ts → lib/client.js 麦克风按钮(官方 slot conversation.input.right );MediaRecorder 16 kHz 单声道录音;WAV 编码后 POST 到本机 ASR;用官方事件把文本追加进草稿 - 按钮挂在官方 slot conversation.input.right (发送键左侧同一行),不替换 composer、不动发送键。 - 识别结果通过官方 scoped 事件 slash/input-insert-text (payload { text, span } ,span 带 draftRev CAS)追加到草稿末尾;草稿非空时前面补一个空格。 - 不调用未公开的 setDraft、不改 textarea DOM、不自动发送。 - ASR 引擎: sherpa-onnx-node (npm 包,含 Windows x64 预编译二进制)+ 模型 sherpa-onnx-sense-voice-zh-en-ja-ko-yue-int8-2024-07-17 (INT8, model.int8.onnx ≈ 228 MB,压缩包 ≈ 229 MB)。 - 不用 Web Speech API(会上传音频且国内不稳定);音频只发到本机回环地址。 安装与构建 启动方式 方式 A:--patch(只验证主机半边 ASR 服务) 浏览器半边需要行名是可解析的 包名 (client-mo…
在 GitHub 查看完整 README →