DaFeiYu Voice Ball: a floating desktop voice companion - click the ball, say one sentence, and it answers out loud. Local Whisper ASR + edge-tts synthesis over a live RuiC-2D animated character; ollama, DSH or DeepSeek LLM backends; standalone Electron window with first-run auto-setup (clones the character engine, creates a venv, installs dependencies).
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:qfnin/dafeiyu-voice-ball
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.
一颗住在桌面右上的小圆球,点一下就能和住在里面的鲸鱼娘「大肥鱼1号」语音聊天。
大肥鱼语音球是一个全本地运行的 Windows 桌面语音伴侣:透明置顶悬浮球里渲染 RuiC-2D 的实时角色,按住说话 → 本地 Whisper 识别 → LLM 回答 → edge-tts 合成开口说话。角色会眨眼、摆尾、口型对齐。
所有数据(缓存、日志、模型、配置)都写在项目自己的目录里,不占 C 盘、不上传任何语音。
功能
- 🎈 桌面悬浮球:透明无边框置顶小窗(Electron),位置记忆、右键菜单、开机自启、双击从最小化恢复
- 🗣️ 语音对话:麦克风拾音 → faster-whisper 本地识别(自动断句)→ LLM → edge-tts 合成,口型随音量驱动
- 🧠 三种回答后端,
config.json里llm_backend一键切换:后端 说明 需要什么 ollama本地模型,稳且免费(默认) 安装 Ollama 并 ollama pull qwen2.5-coder:7bdsh走本机 DeepSeek Harness 的额度 本机运行 dsh web(端口 3425) deepseekDeepSeek 官方 API 设置环境变量 DEEPSEEK_API_KEY - 🐋 角色可换:
project字段指向任意 RuiC-2D 工程,默认自带「大肥鱼1号」 - 🎭 人设可改:
persona/whale-system-prompt.txt直接编辑
架构
大肥鱼语音球.vbs (双击启动,防重复启动)
└─ app/start.ps1
├─ app/voice_bridge.py 语音桥 :8798(faster-whisper 识别 + LLM 调度)
└─ app/launch.py
└─ shell/main.js Electron 悬浮球窗口
├─ RuiC-2D 服务 :8796 /pet.html?project=da-fei-yu-1(角色渲染)
├─ 语音桥 :8798(录音/合成/对话状态)
└─ edge-tts(子进程合成 mp3,逐句播放)
快速开始
前置要求
安装
git clone https://github.com/HRuiCcc/dafeiyu-voice-ball.git
cd dafeiyu-voice-ball
powershell -ExecutionPolicy Bypass -File scripts\setup.ps1
setup.ps1 会自动:克隆角色引擎 RuiC-2D 到仓库旁边 → 建 Python venv 装依赖 → 装 Electron → (可选)预下载 Whisper 模型。
启动
双击仓库根目录的 大肥鱼语音球.vbs。球出现在屏幕右上角:
- 点一下球上的麦克风按钮,说一句话——说完自动断句识别,回答完自动回待机;再点一下说下一句
- 右键 弹出菜单:置顶开关、开机自启、静态模式、退出
- 再次双击
.vbs只会把球从最小化恢复,不会重复启动
使用 DeepSeek 官方 API(可选)
# 设置环境变量(或在 系统属性 → 环境变量 里永久设置)
setx DEEPSEEK_API_KEY "sk-你的key"
然后把 config.json(首次启动前复制 config.example.json)里的 "llm_backend" 改成 "deepseek"。
配置说明
复制 config.example.json 为 config.json 后修改(球的位置等会被程序自动写回):
| 字段 | 默认 | 说明 |
|---|---|---|
project |
da-fei-yu-1 |
RuiC-2D 角色工程名 |
diameter |
360 |
球直径(px) |
voice |
zh-CN-XiaoyiNeural |
edge-tts 音色,任意 官方音色 名 |
rate / pitch |
+10% / +30Hz |
语速 / 音调 |
whisper |
base |
识别模型:tiny(0.3s) base(0.6s) small(2.3s) |
llm_backend |
ollama |
ollama | dsh | deepseek |
model |
qwen2.5-coder:7b |
后端对应的模型名 |
input_device |
null |
麦克风设备号;null = 每次通话自动探测有信号的设备 |
silence_rms |
35 |
说话音量门槛(环境噪声大就调高) |
topmost |
true |
球是否置顶 |
hardCircle |
false |
是否用系统圆形裁切硬边(默认靠页面透明圆,边缘更细腻) |
目录结构
dafeiyu-voice-ball/
├─ 大肥鱼语音球.vbs 双击启动
├─ config.example.json 配置模板(复制为 config.json)
├─ app/ Python 语音链路(识别/LLM/合成调度 + 启动器)
│ ├─ voice_bridge.py 语音桥 HTTP 服务 :8798
│ ├─ voice_engine.py 核心引擎:录音断句、whisper、LLM 后端、合成
│ ├─ launch.py 拉起 Electron
│ ├─ start.ps1 顶层启动器
│ └─ selftest_*.py 开发期自测脚本(抓屏验收球/菜单/麦克风)
├─ shell/ Electron 外壳(窗口/右键菜单/开机自启/TTS 子进程)
├─ persona/ 大肥鱼1号的系统提示词与人设
├─ assets/ 球图标
├─ tts/ 合成音频输出 + 试音样本
├─ scripts/
│ ├─ setup.ps1 一键安装
│ └─ prepare-models.ps1 预下载 Whisper 模型
└─ cache/ logs/ models/ 运行时产物(git 忽略)
常见问题
Q: 首次语音对话没反应?
第一次会下载 Whisper 模型(约 150MB,走 hf-mirror 镜像),等一会儿;或先跑 scripts\prepare-models.ps1。
Q: 识别不到我说话?
环境噪声大把 silence_rms 调高;还不行就跑 python app\selftest_mic2.py 逐个设备测真实 RMS,再把设备号写进 input_device。
Q: 想让球停在别的位置?
直接拖球,位置自动记忆(写回 config.json)。
Q: 不想用 ollama,想用回 DeepSeek? 见上文「使用 DeepSeek 官方 API」。
Q: 为什么坚持全本地? 麦克风音频、对话记录、Whisper 推理全部不出本机;只有 LLM 回答走你选择的后端 API。
致谢
- 角色与渲染引擎:RuiC-2D(同一作者的另一个项目)
- 语音识别:faster-whisper
- 语音合成:edge-tts
作者
清风同学灬 · GitHub: qfnin
License
Links
More in this category
Yuuyuko-uu/dsh-tts-bridge★ 257
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★ 130
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.
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★ 61
Adds Xiaomi MiMo, Doubao, Breeze and browser speech to DSH, with external provider and local model adapters, text filtering, streaming read-aloud, audio downloads, sound effects, desktop pets, QQ Bot and AI Passport integration.
1624318455/dsh-plugin-tts★ 60
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.
beiyege-01/dsh-voice-ai-girlfriend-plugin★ 57
Voice AI girlfriend for the Web UI: FunASR mic input, Qwen3-TTS spoken replies, companion animation window, and two-way QQ chat (text/voice/image push) via NapCat.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.