MiMo-Code icon indicating copy to clipboard operation
MiMo-Code copied to clipboard

[Bug] Voice input not working on Windows - sox -d flag doesn't detect default recording device

Open Jieyi-Jiang opened this issue 5 months ago • 0 comments

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

  1. Install sox via winget: winget install ChrisBagwell.SoX
  2. Set microphone as default recording device in Windows Sound Control Panel (mmsys.cpl)
  3. Open MiMoCode, run /voice, click [Voice]
  4. 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)

Jieyi-Jiang avatar Jun 11 '26 14:06 Jieyi-Jiang