dsh-voice-danmaku: Send Bilibili Danmaku via Voice in Games Without Switching Windows

Preface

When running agents or tools in DeepSeek Harness (DSH) Desktop, a common requirement is to “keep the Harness running in the background while doing other things in the foreground.” For instance, when watching a Bilibili live stream and wanting to send bullet comments (danmaku), the traditional approach involves Alt+Tab switching to the browser, typing, and switching back to the game, which interrupts the flow of operation. If you are already using DSH 0.2 Desktop and wish to send text to a live stream via global hotkeys + speech recognition, you can check out the community plugin dsh-voice-danmaku (Maintainer: weizhida, Category: Networking Tools). It chains recording, transcription, confirmation, and sending into a single pipeline. Danmaku are still sent by the already logged-in Bilibili live stream page in the browser; the plugin side does not store Bilibili credentials.

What is this

dsh-voice-danmaku is a plugin for DeepSeek Harness: while gaming, speak after pressing a hotkey, the recognition result floats above the game screen, and upon confirmation, a Chrome extension drives the open Bilibili live stream page to send the danmaku, all without leaving the game. The project description states it is in early development; although the functionality is end-to-end verified, interfaces and configuration may still change. The current package version is 0.1.0, and the license is MIT.

Please be aware of the risk notice in the README before use: this tool may trigger game anti-cheat measures leading to account bans, or trigger Bilibili live stream risk control leading to Bilibili account bans. Use at your own risk.

Core Features

Below is an introduction to the capabilities marked as implemented in the README.

Operation Pipeline

Default key bindings (all modifiable in settings):

Key Action
F9 Press once to start recording, press again to end and start recognition
F11 Confirm and send
F10 Cancel

The recognition result is displayed pinned to the top of the screen. The overlay does not steal focus or accept mouse input, allowing the game to be operated normally. The confirmation timeout is controlled by behavior.confirmTimeoutSeconds; no operation for 8 seconds (default) will automatically cancel.

Speech Recognition and Sending

  • Speech recognition utilizes an OpenAI-compatible transcription API; you need to fill in the ASR key in the settings. The author’s example uses Qwen/Qwen3-ASR-1.7B on SiliconFlow, but you can switch service providers and models.
  • Recording relies on ffmpeg available on the system (README recommends winget install Gyan.FFmpeg).
  • Danmaku sending has only one channel: a Bilibili live stream page kept open in Chrome + a Chrome Extension. The extension communicates with the plugin via a local bridge, and the page itself handles wbi signing and sending. The plugin does not store Bilibili cookies or login state.
  • The plugin enforces sending rate limits (minimum interval and hourly cap).

Global Hotkeys and Media Keys

  • Normal global hotkeys can be configured even when a game is in the foreground; games with kernel-level anti-cheat may intercept keyboard hooks. In this case, the README provides Media Keys as an alternative (HID Consumer Control, RegisterHotKey), which can work simultaneously with normal keys.
  • When multiple live stream pages are open simultaneously, you can locate the target by room ID; if the target cannot be determined, it will refuse to send and explain the reason.

Environment and Host Versions

  • DeepSeek Harness 0.2 (Desktop) — The README explicitly states adaptation is only for 0.2; installing on 0.1.x may prevent the app from starting.
  • Windows 10 / 11 (Keyboard hooks, media keys, and pinned overlays are native Windows implementations).
  • No separate Node.js installation is required to use the pre-built plugin; Node is only needed for building from source (engines require >=22.19.0).

Installation and Activation

The plugin is installed with the DSH desktop profile; the README emphasizes not to use the dsh CLI from npm to manipulate the desktop profile.

Execute this in the plugin repository root directory (the script compiles first, then installs into the desktop profile via link:):

powershell -ExecutionPolicy Bypass -File tools/install-plugin.ps1

Manual Installation

You must use the CLI bundled with the desktop client, replacing <DSH Install Directory> and the absolute path of this repository with actual values:

& "<DSH Install Directory>\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add "link:<Absolute Path of this Directory>"

After installation, you must restart DSH (quit from the tray and ensure all DeepSeek Harness processes have ended) for the plugin to load.

Prerequisites for Installation

The README lists five items; missing any one usually prevents full functionality:

  1. ffmpeg (for recording).
  2. Speech Recognition API Key (entered in Settings → Voice Danmaku).
  3. Chrome Extension — Fill in the “Local Bridge Port” and “Local Bridge Token” from the settings page into the extension popup (see extension/README.md in the repo for details); the extension cannot connect to the bridge if the token is empty.
  4. An open, logged-in Bilibili live stream page (background is fine).
  5. Allow DSH to use the microphone (Windows: Settings → Privacy and security → Microphone → Allow desktop apps access).

After restarting DSH, open Settings → Voice Danmaku, fill in the ASR key, and configure the extension and local bridge token; you do not need to fill in Bilibili credentials in the plugin.

Typical Usage

Basic Flow

  1. Ensure ffmpeg is in PATH or its path is specified in settings (the startup log will write the actual path used).
  2. Open the target live stream in the browser and keep the tab present.
  3. In the game, press F9 to speak, then press F9 again to end and recognize; verify the text in the overlay and press F11 to send, or F10 to cancel.
  4. If normal hotkeys do not work in-game, first use the command provided in the README at the repository root to verify if media keys reach the plugin, then enable media keys in settings and capture the binding.

Example of verifying media keys:

npm run verify:media

Config File (Optional)

The settings page can open the patch file for the current profile (for desktop, it is ~/.dsh/profiles/desktop/cordis.patch.yml). Config snippet example (refer to README for specific fields):

- id: voice-danmaku
  name: dsh-voice-danmaku
  config:
    keys:
      record: F9
      send: F11
      cancel: F10
    channel:
      roomId: 'Your Live Stream Room ID'
      page:
        port: 39217
        token: 'Fill the same token as in the extension popup'
    asr:
      apiKey: 'Your Key'

After modifying the config file, there may be a delay of over ten seconds to over a minute for DSH to reload the plugin; keys are stored in plaintext in this file, so please pay attention to local machine security.

The default maximum length for danmaku is 20 characters (channel.maxLength, settable 20–100). If the recognized text is too long, it will be automatically truncated and prompted in the overlay.

Use Cases and Notes

Who it is for: Users already using DSH 0.2 Desktop on Windows, watching Bilibili streams, wanting to send danmaku while gaming, and willing to prepare the ASR key, ffmpeg, and Chrome extension themselves.

Who it is not for / Caution: Environments extremely sensitive to account security or with strict game anti-cheat policies — The README explicitly states the risk of bans. Before installation, you should read the full source code and the MIT license, and understand that the plugin runs with the current DSH process privileges, accessing the microphone, registering global hotkeys, and communicating with the local browser extension.

Project Status: The README claims the functionality is verified end-to-end (including server returning code: 0), but it is in early development. Bilibili frontend changes may cause the extension to fail to find sending controls (the settings page will report detection results rather than failing silently).

Links

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye