Introduction¶
When using DeepSeek Harness (DSH) via the Web GUI, both input and output are plain text. For developers who want to “naturally converse” with the agent, this breaks the flow: you have to type every message by hand, and you still need to wait for the AI to finish generating before copying the reply. This post introduces a plugin that integrates voice input and voice playback into DSH’s chat interface.
What It Is¶
dsh-voice-companion is a DSH plugin maintained by OrdinaryTu. It adds two features to the DSH Web GUI:
- A new “Speak” button below the input box: click to start recording, click again to stop. The recording is transcribed into text and placed in the input box.
- A new “Read Aloud” button next to every assistant reply: click to play, reading the reply in your chosen voice.
The plugin does not rely on any cloud API key. Speech recognition uses the built-in Chinese speech recognizer on Windows (offline), while text-to-speech uses edge-tts (online).
Core Features¶
Voice Input¶
- Click the “Speak” button to start recording; click again to stop.
- The recording format is determined by the browser. The plugin converts it to a 16 kHz mono WAV file via ffmpeg, then transcribes it to text using Windows Speech Recognizer (zh-CN).
- The transcription is placed into the input box, where the developer can edit it before sending.
Voice Output¶
- A “Read Aloud” button appears next to every assistant reply.
- Clicking it synthesizes speech via edge-tts. The voice defaults to
zh-CN-XiaoxiaoNeural, with a rate of −4% and a pitch of −7 Hz. - Synthesized audio is cached in
$DSH_HOME/voice-cache, reused by a hash of the text plus voice name.
Endpoints & Permissions¶
The plugin only exposes its endpoints on the local loopback interface:
GET /dsh-voice/status— query the status of Python, ffmpeg, and the voice.POST /dsh-voice/asr— accept raw audio (webm/ogg/mp4/wav) and return{ ok, text }.POST /dsh-voice/tts— accept{ sessionId, messageId }or{ text }and return{ ok, url }.GET /dsh-voice/audio/<hash>.mp3— return the generated audio.
Dependencies & Configuration¶
The plugin requires the following:
| Capability | Dependency | Notes |
|---|---|---|
| Listen | Windows Speech Recognizer zh-CN |
Built into the OS; the recognizer list is empty if no Chinese voice pack is installed |
| Listen | ffmpeg |
Converts browser-recorded webm/opus to 16 kHz mono WAV |
| Speak | Python + edge-tts |
Already available in the workspace .venv; requires internet access |
Auto-detection order (by priority):
- Python:
DSH_VOICE_PYTHON→E:\smallDSH\伴侣\.venv\Scripts\python.exe→python→py - ffmpeg:
DSH_VOICE_FFMPEG→python -c "import imageio_ffmpeg..."→ffmpeg - Voice:
DSH_VOICE_NAME/DSH_VOICE_RATE/DSH_VOICE_PITCH/DSH_VOICE_VOLUME
Installation & Activation¶
Install the plugin into your DSH workspace via npm:
dsh plugin add github:OrdinaryTu/dsh-voice-companion
After installation, the plugin is automatically injected into the Web GUI—no extra configuration needed.
Typical Usage¶
Voice Input¶
- Click the “Speak” button below the input box in the chat interface.
- Start speaking, then click again to stop.
- The plugin fills the input box with the transcription; you can edit it before sending.
Voice Reply¶
- Wait for the assistant’s reply.
- Click the “Read Aloud” button next to the reply.
- The plugin synthesizes and plays the speech.
Use Cases & Caveats¶
Well suited for developers who want voice interaction, especially:
- Quick voice input for long-form text.
- Scenarios where you need the assistant’s reply read aloud immediately.
Caveats:
- The plugin runs with the privileges of the current DSH process. Review the source code and license before installing.
- Recognition uses a small offline model. Short sentences and everyday colloquial speech are handled well, but long sentences and proper nouns may be misrecognized. That’s why the result is only placed in the input box and never auto-sent.
- edge-tts requires an internet connection. “Read Aloud” will fail when offline, but recording is unaffected.
- Recordings are capped at 30 seconds; the recorder stops automatically on timeout.
- This is a Web GUI feature only. Native WeChat voice bubbles are not yet supported.
Summary¶
dsh-voice-companion fills the “can listen, can speak” gap in the DSH Web GUI by integrating voice input and voice playback directly into the chat interface, eliminating the need for manual copy-and-paste. For more details, check the directory page or the GitHub repository.