# dsh-rail-equalizer Make DSH's **turn navigator rail** — the tick strip on the right side of the chat — move to whatever your computer is currently playing. > Music, video, games: if the sound comes out of the default playback device, the rail reacts to it. > **No permission prompt, no popup, no microphone, no screen recording** — and it still works with headphones on. ![The turn navigator rail reacting to system audio](assets/screenshot-1.png) ![The "律动" toggle row in the sidebar](assets/screenshot-2.png) **Windows only** — the capture layer is WASAPI. 中文说明见 [README.md](README.md). --- ## How it gets the audio This is the only heavy part of the plugin, and it is worth explaining. The browser's `getDisplayMedia` **cannot be "authorized once"**. That is a deliberate Chrome/Edge security decision: every call has to pick a share target again, the grant is never persisted, and no API gets around it. Capturing the microphone, on the other hand, is completely useless when you are wearing headphones. So this plugin uses **host-side WASAPI loopback** instead: the DSH host process (Node) calls Windows Core Audio COM interfaces directly through `koffi` and reads the PCM that the default render device is already mixing. ``` IMMDeviceEnumerator.GetDefaultAudioEndpoint(eRender) → IMMDevice.Activate(IAudioClient) → IAudioClient.Initialize(AUDCLNT_STREAMFLAGS_LOOPBACK) → IAudioClient.GetService(IAudioCaptureClient) → poll GetBuffer / ReleaseBuffer ``` This is **the same mechanism OBS uses to capture desktop audio**. It is not "recording" — it reads the buffer the system mixer has already handed to the sound card, therefore: - there is no permission concept to ask anyone for - headphones / speakers / HDMI / virtual devices all resolve to the **default render device** (switch the output in Windows and this follows) - read-only: it never writes, never changes volume, never disturbs whatever is playing - audio is reduced to levels **in memory only** — it never leaves the machine and is never written to disk `koffi` ships **prebuilt binaries** through `optionalDependencies` (`@koromix/koffi-win32-x64`), so it works on install with no Visual Studio, no node-gyp, and no toolchain. (koffi's own `install` script is not required at runtime — the native binary resolves from the optional platform package either way.) ## How it avoids touching the official component The rail is rendered by `@deepseek-ai/dsh-client-ui-chat`. This plugin does **not** patch it, fork it, or replace any of its code or components. The browser half does exactly four things: | What | Detail | |---|---| | Tag it | add a `data-dsh-eq` attribute to the rail's `