Skip to main content

cordova-plugin-tts Alternative for Capacitor

cordova-plugin-tts alternative for Capacitor: @capgo/capacitor-speech-synthesis with speak, cancel, voices, events, and synthesizeToFile instead of TTS.speak promises.

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

The practical cordova-plugin-tts alternative for a Capacitor app is @capgo/capacitor-speech-synthesis. It keeps text to speech on native AVSpeech and Android TTS engines, expands the Cordova TTS object into typed promises, and documents queue control, voice lists, and file export. This guide covers npm facts, install steps, usage, and an API map for your Cordova to Capacitor move.

Why leave cordova-plugin-tts in Capacitor

cordova-plugin-tts on npm is version 0.2.3. The registry modified timestamp is 16 January 2024. The npm repository URL points to vilic/cordova-plugin-tts.

The README documents a global TTS object with:

  • speak(text) or speak({ text, locale, rate, category }) returning a Promise
  • stop() to halt speech
  • checkLanguage() returning a language string
  • openInstallTts() to open the Android TTS installer
  • an empty speak('') call to interrupt queued speech

Cordova exposes a minimal surface: no pause or resume, no utterance events, no voice picker API, and rate is documented as 0 to 1 on the Cordova side.

@capgo/capacitor-speech-synthesis latest on npm is 8.0.29 with a modified date of 12 November 2026. src/definitions.ts documents speak, synthesizeToFile, cancel, pause, resume, isSpeaking, isAvailable, getVoices, getLanguages, addListener('start' | 'end' | 'boundary' | 'error'), and iOS activateAudioSession. 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-synthesis
bunx cap sync

No extra plist keys are required beyond what your app already uses for playback. On Android, ensure the device has a TTS engine installed (the Cordova plugin used openInstallTts() for that case).

Usage example

import { SpeechSynthesis } from '@capgo/capacitor-speech-synthesis';

export async function announceTurn(direction: string) {
  const { isAvailable } = await SpeechSynthesis.isAvailable();
  if (!isAvailable) throw new Error('Speech synthesis unavailable');

  const { utteranceId } = await SpeechSynthesis.speak({
    text: direction,
    language: 'en-US',
    rate: 1.0,
    pitch: 1.0,
    volume: 1.0,
    queueStrategy: 'Flush',
  });

  await new Promise<void>((resolve) => {
    void SpeechSynthesis.addListener('end', (event) => {
      if (event.utteranceId === utteranceId) {
        console.log('Finished', utteranceId);
        resolve();
      }
    });
  });
}

Migrating from Cordova to Capacitor

// Before (Cordova)
TTS.speak({ text: 'hello, world!', locale: 'en-GB', rate: 0.75 });
// After (Capacitor)
import { SpeechSynthesis } from '@capgo/capacitor-speech-synthesis';

await SpeechSynthesis.speak({
  text: 'hello, world!',
  language: 'en-GB',
  rate: 0.75,
});
// Before (Cordova)
TTS.stop();
// After (Capacitor)
await SpeechSynthesis.cancel();

API mapping table

cordova-plugin-tts (TTS) @capgo/capacitor-speech-synthesis
speak(text) speak({ text }) returns { utteranceId }
speak({ text, locale, rate }) speak({ text, language: locale, rate }) (Capgo rate range is 0.1 to 10.0 per SpeakOptions)
speak({ category }) (iOS ambient) activateAudioSession({ category: 'Ambient' or 'Playback' })
stop() cancel()
Empty string interrupt via speak('') cancel() or speak({ text: '...', queueStrategy: 'Flush' })
checkLanguage() getLanguages() or isLanguageAvailable({ language })
openInstallTts() (Android) Open system TTS settings from your UI; not wrapped in Capgo
Not in Cordova pause(), resume(), isSpeaking(), getVoices(), synthesizeToFile(), addListener('start', 'end', 'boundary', 'error')
Cordova plugin install bun add @capgo/capacitor-speech-synthesis plus bunx cap sync

Ship native builds with Capgo Build, then deliver prompt copy changes with Capgo live updates. 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.