MiMo-Code
MiMo-Code copied to clipboard
[Bug] Voice input not working on Windows - sox -d flag doesn't detect default recording device
Bug Description
Voice input (/voice) doesn't work on Windows because sox's -d (default device) flag fails to detect the default recording device.
Steps to Reproduce
- Install sox via winget:
winget install ChrisBagwell.SoX - Set microphone as default recording device in Windows Sound Control Panel (
mmsys.cpl) - Open MiMoCode, run
/voice, click [Voice] - Error: "?????????????????? sox"
Root Cause
In packages/opencode/src/cli/cmd/tui/util/voice.ts, the win32 recorder uses:
win32: [
() =>
which("sox")
? { cmd: "sox", pipeArgs: () => ["-d", "-r", "16000", "-c", "1", "-b", "16", "-t", "raw", "-"] }
: null,
],
The -d flag fails on Windows with "Sorry, there is no default audio device configured" even when a microphone is set as the default recording device.
Expected Fix
Adding -t waveaudio before -d fixes the issue:
# Fails:
sox -d -r 16000 -c 1 -b 16 -t raw -
# Works:
sox -t waveaudio -d -r 16000 -c 1 -b 16 -t raw -
Environment
- OS: Windows 11
- MiMoCode: V0.1.0
- SoX: 14.4.2 (installed via winget)
- Microphone: Realtek(R) Audio Microphone Array (set as default recording device)