Skip to main content

cordova-plugin-speechrecognition Alternative for Capacitor

cordova-plugin-speechrecognition alternative for Capacitor: speech to text with @capgo/capacitor-speech-recognition, partial results, and on-device recognition.

Illustration of migrating a Cordova app to Capacitor, used for a speech recognition plugin guide

The practical cordova-plugin-speechrecognition alternative for a Capacitor app is @capgo/capacitor-speech-recognition. It maps window.plugins.speechRecognition callbacks to SpeechRecognition promises, streams partial transcripts through listeners, and documents optional on-device recognition in definitions.ts. This guide lists npm facts, install steps, usage, and an API map for your Cordova to Capacitor move.

Why leave cordova-plugin-speechrecognition in Capacitor

cordova-plugin-speechrecognition on npm is version 1.2.0. The registry modified timestamp is 14 June 2022. The npm repository URL points to pbakondy/cordova-plugin-speechrecognition.

The README documents window.plugins.speechRecognition with:

  • isRecognitionAvailable(success, error) returning a boolean
  • startListening(success, error, options) with language, matches, prompt, showPopup, showPartial
  • stopListening(success, error)
  • getSupportedLanguages(success, error) returning a string array
  • hasPermission(success, error) and requestPermission(success, error) returning booleans

In a Capacitor codebase the Cordova plugin still uses callback style results and the README notes that Android stops when the speaker finishes a sentence while iOS needs a manual stopListening call.

@capgo/capacitor-speech-recognition latest on npm is 8.6.0 with a modified date of 17 November 2026. src/definitions.ts documents available(), start, stop, forceStop, getSupportedLanguages, isListening, checkPermissions, requestPermissions, addListener('partialResults'), addListener('listeningState'), and useOnDeviceRecognition. Capgo ships fixes on an open source cadence where a human still reviews, tests and merges 50+ pull requests daily.

Install

bun add @capgo/capacitor-speech-recognition
bunx cap sync

On iOS add NSSpeechRecognitionUsageDescription and NSMicrophoneUsageDescription to Info.plist. On Android declare RECORD_AUDIO when you use inline recognition without the system popup.

Usage example

import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';

export async function dictateOnce() {
  const { available } = await SpeechRecognition.available();
  if (!available) throw new Error('Speech recognition unavailable');

  const permission = await SpeechRecognition.requestPermissions();
  if (permission.speechRecognition !== 'granted') {
    throw new Error('Permission denied');
  }

  const { matches } = await SpeechRecognition.start({
    language: 'en-US',
    maxResults: 5,
    partialResults: false,
    popup: true,
    prompt: 'Say something',
  });

  return matches?.[0];
}

Migrating from Cordova to Capacitor

// Before (Cordova)
window.plugins.speechRecognition.startListening(
  function (matches) {
    console.log(matches);
  },
  function (err) {
    console.error(err);
  },
  { language: 'en-US', showPartial: true, showPopup: false },
);
// After (Capacitor)
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';

await SpeechRecognition.addListener('partialResults', ({ matches }) => {
  console.log(matches?.[0]);
});

const { matches } = await SpeechRecognition.start({
  language: 'en-US',
  partialResults: true,
  popup: false,
  maxResults: 5,
});
console.log(matches);
// Before (Cordova)
window.plugins.speechRecognition.isRecognitionAvailable(success, error);
// After (Capacitor)
const { available } = await SpeechRecognition.available();

API mapping table

cordova-plugin-speechrecognition (window.plugins.speechRecognition) @capgo/capacitor-speech-recognition
isRecognitionAvailable(success, error) available() returns { available }
startListening(success, error, options) start({ language, maxResults, prompt, popup, partialResults, ... }) returns { matches }
options.matches maxResults
options.showPopup popup
options.showPartial partialResults plus addListener('partialResults', ...)
stopListening(success, error) stop() or forceStop({ timeout })
getSupportedLanguages(success, error) getSupportedLanguages() returns { languages }
hasPermission(success, error) checkPermissions() returns { speechRecognition }
requestPermission(success, error) requestPermissions()
Not in Cordova isListening, isOnDeviceRecognitionAvailable, useOnDeviceRecognition, addListener('listeningState'), addListener('audioLevel')
Cordova plugin install bun add @capgo/capacitor-speech-recognition plus bunx cap sync

Microphone and speech permission strings ship in the native binary. Use Capgo Build for store builds, then ship transcript UI with Capgo live updates where the logic stays in JavaScript. For the full platform move, read the Cordova to Capacitor migration guide.

Live updates for Capacitor apps

When a web-layer bug is live, ship the fix through Capgo instead of waiting days for app store approval. Users get the update in the background while native changes stay in the normal review path.

Latest from our Blog

Capgo gives you the best insights you need to create a truly professional mobile app.