vesktop-stereo-mic

True stereo Discord voice on macOS/Linux via Vesktop — a Vencord userplugin.
Log | Files | Refs | README | LICENSE

README.md (3362B)


      1 # StereoMic — true stereo mic for Discord on macOS/Linux (Vesktop)
      2 
      3 Discord downmixes your microphone/input to **mono**. The official desktop app does voice
      4 in a native module that's signing-locked on macOS, so the Windows "stereo mic" patchers
      5 don't work here. But **Vesktop** (and web Discord) do voice in Chromium WebRTC, where the
      6 fix is pure JavaScript.
      7 
      8 `StereoMic` is a tiny Vencord userplugin that makes your voice transmit in **true stereo**
      9 at high bitrate. **Listeners need to do nothing** — their client decodes the stereo Opus
     10 automatically.
     11 
     12 ## How it works
     13 
     14 1. **SDP munge on BOTH descriptions.** It injects `stereo=1; sprop-stereo=1;
     15    maxaveragebitrate=320000` into the Opus `a=fmtp` line of the local offer **and the
     16    remote answer**. The remote one is the essential half: Chromium's Opus encoder only
     17    sends 2 channels if the *receiver* signals stereo, and Discord's SFU answer advertises
     18    mono — so you must rewrite the answer too. (Munging only the offer = still mono.)
     19 2. **2-channel unprocessed capture.** It requests `channelCount: 2` and disables
     20    `echoCancellation` / `noiseSuppression` / `autoGainControl` so the stereo image
     21    survives to the encoder.
     22 
     23 You still need to feed a genuinely **stereo** source into your input device (e.g. a
     24 hard-panned mix, a stereo virtual device like Loopback/BlackHole 2ch). Mono in = mono out.
     25 
     26 ## Install (Vesktop)
     27 
     28 Vesktop has no built-in userplugin folder, so build Vencord with the plugin and point
     29 Vesktop at the build.
     30 
     31 ```bash
     32 # 1. build Vencord with the plugin
     33 git clone https://github.com/Vendicated/Vencord
     34 mkdir -p Vencord/src/userplugins/stereoMic
     35 cp stereoMic/index.ts Vencord/src/userplugins/stereoMic/index.ts
     36 cd Vencord && pnpm install && pnpm build
     37 ```
     38 
     39 Then load the build in Vesktop, either:
     40 
     41 **A) Swap the files (works when launching Vesktop normally):**
     42 - Quit Vesktop.
     43 - Copy `Vencord/dist/vencordDesktop*` over
     44   `~/Library/Application Support/vesktop/sessionData/vencordFiles/` (macOS path; Linux:
     45   `~/.config/vesktop/sessionData/vencordFiles/`).
     46 - In `…/vesktop/settings/settings.json`, set `"autoUpdate": false` so Vesktop doesn't
     47   re-download stock Vencord over your build.
     48 - Relaunch.
     49 
     50 **B) Env var (cleaner, no auto-update conflict):** launch Vesktop with
     51 `VENCORD_FILES_DIR=/abs/path/to/Vencord/dist`. (For a Dock launch on macOS, set it via a
     52 LaunchAgent or a wrapper script.)
     53 
     54 Finally: **User Settings → Plugins → enable `StereoMic`.** Rejoin voice — it auto-applies
     55 to every connection.
     56 
     57 ## Quick test without building
     58 
     59 `console-snippet.js` is the same logic as a one-shot you can paste into Vesktop's DevTools
     60 console (`Cmd/Ctrl+Opt+I`). Paste it, then leave & rejoin voice. Good for verifying before
     61 you commit to a build.
     62 
     63 ## Verify
     64 
     65 Feed a hard-panned left→right source in and have a friend (or a second account) confirm the
     66 audio pans fully L↔R. Console will log `[StereoMic] munged setLocalDescription` and
     67 `[StereoMic] munged setRemoteDescription`.
     68 
     69 ## Caveats
     70 
     71 - Client modification — technically against Discord's ToS; use at your own risk.
     72 - Verified on macOS Vesktop 1.6.x / Vencord (main). The SDP shape can change; if it stops
     73   working, check that the Opus payload is still `opus/48000/2` and that both munge lines fire.
     74 - Rebuild to update Vencord (auto-update is off while using the file-swap method).
     75 
     76 ## License
     77 
     78 MIT