Enable /voice in Claude Code on Windows.
Claude Code's /voice command fails on Windows with:
Voice recording requires the native audio module, which could not be loaded.
This happens because:
- The native
audio-capture.nodebinary isn't shipped for Windows - The SoX fallback (which works on macOS/Linux) is explicitly blocked on Windows
Tracked issues: #30915, #31065, #32249
This tool:
- Installs SoX (Sound eXchange) for Windows audio capture
- Patches
cli.jsto enable the SoX fallback on Windows using thewaveaudiodriver
No native compilation needed. No dependencies beyond SoX and Node.js.
Double-click install.bat or run in PowerShell:
.\install.ps1# 1. Install SoX
winget install ChrisBagwell.SoX
# 2. Restart your terminal (PATH update)
# 3. Run the patcher
.\install.ps1 -SkipSoXThen restart Claude Code and run /voice.
Six targeted edits to cli.js (backup saved automatically):
| # | Function | What | Why |
|---|---|---|---|
| 1 | checkRecordingAvailability |
Remove win32 early-reject | Let it fall through to SoX check |
| 2 | checkVoiceDependencies |
Remove win32 early-reject | Same |
| 3 | startRecording |
Remove win32 early-return | Allow SoX recording path |
| 4 | m7z (SoX spawn) |
rec → sox -t waveaudio default |
Windows SoX uses waveaudio driver, not -d |
| 5 | b7z (dep check) |
dl("rec") → dl("sox") on win32 |
Windows has sox.exe, not rec |
| 6 | u7z (avail check) |
dl("rec") → dl("sox") on win32 |
Same |
The patch is applied to cli.js which gets overwritten on update. Re-run:
.\install.ps1Or if you want to automate it, add a post-install hook or alias.
.\install.ps1 # Full install (SoX + patch)
.\install.ps1 -SkipSoX # Patch only (SoX already installed)
.\install.ps1 -Verify # Check patch status and test audio
.\install.ps1 -Uninstall # Restore original cli.js from backup- Windows 10/11
- Claude Code installed via npm
- Node.js (comes with Claude Code)
- winget (pre-installed on Windows 11, available for Windows 10)
- A microphone
Tested on:
- Windows 11 Home 10.0.26200
- Claude Code v2.1.74
- SoX v14.4.2 (via winget)
- Node.js v24.x
The patch targets specific string patterns in the minified cli.js. If Anthropic refactors the voice module, the patch may need updating — open an issue.
On macOS and Linux, when the native audio module fails to load, Claude Code falls back to the rec command (part of SoX) to capture audio:
rec -q --buffer 1024 -t raw -r 16000 -e signed -b 16 -c 1 -
On Windows this fallback is blocked. This patch:
- Removes the three
if(process.platform==="win32") return ...blocks that prevent fallback - Replaces the
reccommand withsox -t waveaudio default(Windows SoX doesn't includerec, and needs thewaveaudiodriver specified explicitly) - Updates dependency checks to look for
sox.exeinstead ofrecon Windows
Audio specs: 16kHz, mono, 16-bit signed PCM — matching what Claude Code's voice pipeline expects.
MIT