moeru-ai/airi · error

3. Browser requires user gesture - ensure microphone was ena

Error message

3. Browser requires user gesture - ensure microphone was enabled by user action

What it means

In streamWebSpeechAPITranscription, startRecognition() returned false, meaning the Web Speech API recognition object could not start immediately. The code does not throw; it logs diagnostic warnings listing likely causes — ungranted microphone permission, unsupported browser, and (this message) recognition.start() not being triggered from a user gesture. It signals degraded/failed transcription startup rather than a runtime exception.

Source

Thrown at packages/provider-inference/src/providers/local/browser-web-speech-api/provider.ts:460

    console.info('Web Speech API sound ended')
  }

  recognition.onaudioend = () => {
    console.info('Web Speech API audio capture ended')
  }

  recognition.onnomatch = () => {
    console.info('Web Speech API: No speech match')
  }

  const started = startRecognition()
  if (!started) {
    // If immediate start failed, it might be a permission issue
    // Web Speech API will prompt for permission automatically, so we just log
    console.warn('Web Speech API recognition did not start immediately. This might be due to:')
    console.warn('1. Microphone permission not granted - browser should prompt automatically')
    console.warn('2. Recognition already running - this is normal if called multiple times')
    console.warn('3. Browser requires user gesture - ensure microphone was enabled by user action')

    // Don't retry immediately - wait for permission or user action
    // The recognition instance is already created, so it can be started later if needed
  }

  return {
    fullStream,
    text: deferredText.promise,
    textStream,
    recognition: recognitionInstance,
  }
}

View on GitHub (pinned to f679616c34)

Solutions

  1. Trigger recognition.start() from a direct user gesture such as a microphone button click
  2. Confirm the browser supports SpeechRecognition and the page is on HTTPS or localhost
  3. Check microphone permission state via navigator.permissions and prompt for it from user action
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/provider-inference/src/providers/local/browser-web-speech-api/provider.ts:460 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of moeru-ai/airi@f679616c34 (2026-09-08). Data as JSON: /api/errors/348d9eb884338fa3. Report an issue: GitHub.