moeru-ai/airi · warning

Web Speech API: Microphone access issue. Please check microp

Error message

Web Speech API: Microphone access issue. Please check microphone permissions.

What it means

A specific Web Speech API error branch: recognition.onerror received 'audio-capture', meaning the browser could not capture audio from the microphone device. This is logged as a warning with guidance to check microphone permissions/hardware and the handler returns without failing the stream.

Source

Thrown at packages/stage-ui/src/libs/providers/providers/browser-web-speech-api/provider.ts:273

      console.info('Web Speech API transcribed (final):', trimmedTranscript)
    }

    // Log interim results for debugging (don't emit as final)
    if (interimTranscript && recognition.interimResults) {
      console.info('Web Speech API transcribed (interim):', interimTranscript)
    }
  }

  recognition.onerror = (event: any) => {
    const errorType = event.error || 'unknown'
    console.warn('Web Speech API error:', errorType)

    if (errorType === 'no-speech') {
      return
    }

    if (errorType === 'audio-capture') {
      console.warn('Web Speech API: Microphone access issue. Please check microphone permissions.')
      return
    }

    if (errorType === 'network' || errorType === 'aborted') {
      return
    }
    const error = new Error(`Speech recognition error: ${errorType}`)
    fullStreamCtrl?.error(error)
    textStreamCtrl?.error(error)
    deferredText.reject(error)
    deferredText.isRejected = true
    options?.onSpeechEnd?.(fullText)
  }

  recognition.onend = () => {
    console.info('Web Speech API recognition ended. Continuous mode:', options?.continuous !== false, 'Aborted:', options?.abortSignal?.aborted)

    // If continuous mode and not aborted, restart recognition

View on GitHub (pinned to 677329427f)

Solutions

  1. Physically verify a microphone is connected and selected as the system default input.
  2. Re-enable OS microphone access for the browser (Windows privacy settings / macOS Privacy & Security → Microphone).
  3. Close other apps holding the microphone exclusively, then restart recognition.
  4. If on a VM/remote session, attach an audio input device or use a server-side transcription provider instead.
Defensive patterns

Strategy: validation

Validate before calling

async function hasLiveMicrophone(): Promise<boolean> {
  try {
    const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
    stream.getTracks().forEach(t => t.stop())
    return true
  }
  catch {
    return false
  }
}
// run before starting continuous recognition

Try / catch

recognition.onerror = (event) => {
  if (event.error === 'audio-capture') {
    // stop recognition, show 'check microphone' guidance, allow retry
    return
  }
}

Prevention

When it happens

Trigger: SpeechRecognition.start() runs with no microphone available/selected, the OS mic is muted/disabled, the browser's microphone device disappeared mid-session (unplugged headset, device switch), or another application holds exclusive access to the capture device.

Common situations: Headset disconnected after permission was granted; default input device changed while recognition was active; OS-level privacy switch (Windows mic toggle, macOS mic permission for the browser) turned off; remote desktop/VM without an audio input device.

Related errors


AI-assisted analysis of moeru-ai/airi@677329427f (2026-08-18). Data as JSON: /api/errors/d0fb506e9c80eb59. Report an issue: GitHub.