dsh-VoiceChat
一个DSH的语音聊天插件 | Realtime voice chat plugin for DeepSeek Harness: configurable translate + multi-TTS + auto-start local servers.
- Stars
- 1
- Language
- JavaScript
- Created
- Aug 23, 2026
- Updated
- Aug 23, 2026
Introduction
dsh-VoiceChat
A realtime voice chat plugin that makes DeepSeek Harness agents speak out loud (dynamic Cordis plugin).
Every assistant message automatically: translate on demand → synthesize with the selected TTS → auto-play, with a 🔊/⏸/▶ button (play / pause / resume / replay) at the end of the message.
Features
- Conditional translation: only calls the translation API when
voiceLanguage≠aiLanguage; otherwise the original text is synthesized directly - OpenAI-compatible translation: configurable
baseUrl/model/apiKey(DeepSeek by default; switch to OpenAI by changingbaseUrl/model) - Multiple TTS providers: local (Style-Bert-VITS2 / GPT-SoVITS) + free cloud (edge-tts) + cloud (OpenAI / DashScope / Qwen-TTS / ElevenLabs)
- autoStart: automatically starts local TTS services on plugin activation (health-checked, never starts duplicates)
- Long text: chunks by each provider's
maxChunkand stitches the audio together
Installation
# from a local checkout
dsh plugin --profile web add "file:/path/to/dsh-VoiceChat"
# or, once published to npm
dsh plugin --profile web add dsh-VoiceChat
Directory structure
dsh-VoiceChat/
├── speak.mjs # executor: translate + pluggable TTS + chunk/stitch
├── config.json # configuration
├── config.example.json # configuration example
├── package.json # dependencies (edge-tts needs ws / https-proxy-agent)
├── LICENSE # MIT
├── played.json # already-auto-played list (runtime artifact)
├── wav/ # generated audio (runtime artifact)
├── lib/
│ ├── host.mjs # plugin Host half source
│ ├── client.mjs # plugin Client half source
│ └── edge-tts.mjs # edge-tts protocol implementation (from dsh-voice, MIT)
└── .gitignore
Quick start
- Put this directory under the session workspace (default
~/.dsh) as the.dsh-VoiceChatfolder (the Host locates it via the workspace-relative path.dsh-VoiceChat, portable across machines) npm install(or create a node_modules junction if deps already exist locally)- Copy
config.example.json→config.json, fill in keys and provider - Activate the plugin (see below)
Configuration (config.json)
{
"translator": { // OpenAI-compatible translation API
"apiKey": "sk-...", // DeepSeek or OpenAI key
"baseUrl": "https://api.deepseek.com", // or https://api.openai.com/v1
"model": "deepseek-chat", // or gpt-4o-mini
"targetLanguage": "ja"
},
"aiLanguage": "zh", // language the AI replies in
"voiceLanguage": "ja", // voice target language (configurable; skips translation when equal to aiLanguage)
"ttsProvider": "opentts", // voice generation model
"nodePath": "", // node executable (auto-resolved when empty)
"autoStart": { "enabled": true, "servers": [ { "name": "...", "command": "...", "args": [...], "cwd": "...", "healthUrl": "..." } ] }
}
TTS providers
| provider | type | description | required config |
|---|---|---|---|
style-bert-vits2 | local | server_fastapi /voice (default) | url, modelId, speakerId |
gpt-sovits | local | POST /tts (api_v2) | url, refAudioPath |
edge-tts | cloud free | Microsoft Edge TTS | voice (e.g. ja-JP-NanamiNeural) |
openai | cloud/local | /audio/speech, OpenAI-protocol compatible local servers | apiKey, voice |
dashscope | cloud (Aliyun) | Tongyi sambert text2audio | apiKey, voice |
qwen-tts | cloud (Aliyun) | Tongyi qwen-tts | apiKey, voice |
elevenlabs | cloud | ElevenLabs | apiKey, voiceId |
License
MIT