---
description: Capacitor plugin for synthesizing speech from text (also known as text-to-speech) with advanced features like voice selection, pitch, and rate control.
title: Capacitor Speech Synthesis Plugin for Android, iOS & Web - Capawesome
image: https://capawesome.io/docs/assets/images/social/sdks/capacitor/speech-synthesis.png
---

<!doctype html> 

[Skip to content ](#capacitor-speech-synthesis-plugin) 

[🔐 Introducing the **Capacitor Vault** plugin — store secrets behind biometrics or a device passcode. ](/blog/announcing-the-capacitor-vault-plugin/) 

* [ SDKs ](/docs/sdks/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Home Indicator ](/docs/sdks/capacitor/home-indicator/)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Light Sensor ](/docs/sdks/capacitor/light-sensor/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Permissions ](/docs/sdks/capacitor/permissions/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ Photo Manipulator ](/docs/sdks/capacitor/photo-manipulator/)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Proximity Sensor ](/docs/sdks/capacitor/proximity-sensor/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* Speech Synthesis [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Configuration ](#configuration)
* [ Usage ](#usage)
* [ API ](#api)
* [ Type Aliases ](#type-aliases)
* [ Enums ](#enums)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ Breaking Changes ](#breaking-changes)
* [ License ](#license)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ System WebView ](/docs/sdks/capacitor/system-webview/)
* [ Text Interaction ](/docs/sdks/capacitor/text-interaction/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ Configuration ](#configuration)
* [ Usage ](#usage)
* [ API ](#api)
* [ Type Aliases ](#type-aliases)
* [ Enums ](#enums)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ Breaking Changes ](#breaking-changes)
* [ License ](#license)

# Capacitor Speech Synthesis Plugin[¶](#capacitor-speech-synthesis-plugin "Permanent link")

Capacitor plugin for synthesizing speech from text (also known as text-to-speech) with advanced features like voice selection, pitch, and rate control.

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

The Capacitor Speech Synthesis plugin offers one of the most feature-rich text-to-speech solutions for Capacitor apps. Here are some of the key features:

* 🖥️ **Cross-platform**: Supports Android, iOS and Web.
* 🌐 **Multiple Languages**: Supports many different languages.
* 🗣️ **Multiple Voices**: Supports multiple voices for each language.
* 🎚️ **Customization**: Customize the pitch, rate, volume and voice of the speech.
* 🎧 **Background Audio**: Synthesize speech from text while your application runs in the background.
* 📜 **Queue Strategy**: Add or flush the utterance to the queue.
* 🔊 **Events**: Listen for events like `boundary`, `end`, `error` and `start`.
* ⏸️ **Pause/Resume**: Pause and resume speech synthesis.
* 🤝 **Compatibility**: Compatible with the [Audio Player](https://capawesome.io/docs/sdks/capacitor/audio-player/), [Audio Recorder](https://capawesome.io/docs/sdks/capacitor/audio-recorder/) and [Speech Recognition](https://capawesome.io/docs/sdks/capacitor/speech-recognition/) plugins.
* ⚔️ **Battle-Tested**: Used in more than 100 projects.
* 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.
* ⭐️ **Support**: Priority support from the Capawesome Team.
* ✨ **Handcrafted**: Built from the ground up with care and expertise, not forked or AI-generated.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Use Cases[¶](#use-cases "Permanent link")

The Speech Synthesis plugin is typically used whenever an app needs to read text aloud to the user, for example:

* **Read content aloud**: Read articles, messages, or notifications to users, for example while they are driving or exercising.
* **Voice feedback**: Give spoken confirmations or instructions in response to user actions, even while your app runs in the background.
* **Accessibility**: Make your app usable for people with visual impairments or reading difficulties by speaking on-screen content.
* **Language learning**: Demonstrate the pronunciation of words and sentences in many different languages and voices.
* **Audio file generation**: Synthesize speech to an audio file, for example to play it later or share it.

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |
| 7.x.x          | 7.x.x             | Deprecated     |
| 6.x.x          | 6.x.x             | Deprecated     |

## Installation[¶](#installation "Permanent link")

This plugin is only available to [Capawesome Insiders](https://capawesome.io/insiders/). First, make sure you have the Capawesome npm registry set up. You can do this by running the following commands:

`[](#%5F%5Fcodelineno-0-1)npm config set @capawesome-team:registry https://npm.registry.capawesome.io
[](#%5F%5Fcodelineno-0-2)npm config set //npm.registry.capawesome.io/:_authToken <YOUR_LICENSE_KEY>
`

**Attention**: Replace `<YOUR_LICENSE_KEY>` with the license key you received from Polar. If you don't have a license key yet, you can get one by becoming a [Capawesome Insider](https://capawesome.io/insiders/).

Next, you can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-1-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-2-1)Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome-team/capacitor-speech-synthesis` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-3-1)npm install @capawesome-team/capacitor-speech-synthesis
[](#%5F%5Fcodelineno-3-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Proguard[¶](#proguard "Permanent link")

If you are using Proguard, you need to add the following rules to your `proguard-rules.pro` file:

`[](#%5F%5Fcodelineno-4-1)-keep class io.capawesome.capacitorjs.plugins.** { *; }
`

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Usage[¶](#usage "Permanent link")

The following examples show how to speak and synthesize text, pause and cancel speech, check availability, list languages and voices, and handle synthesis events.

### Speak a text[¶](#speak-a-text "Permanent link")

Add an utterance to the utterance queue to be spoken. You can customize the language, pitch, rate, voice, and volume. The `end` event is emitted when the utterance has finished:

`[](#%5F%5Fcodelineno-5-1)import { SpeechSynthesis, QueueStrategy } from '@capawesome-team/capacitor-speech-synthesis';
[](#%5F%5Fcodelineno-5-2)
[](#%5F%5Fcodelineno-5-3)const speak = async () => {
[](#%5F%5Fcodelineno-5-4)  // Add an utterance to the utterance queue to be spoken
[](#%5F%5Fcodelineno-5-5)  const { utteranceId } = await SpeechSynthesis.speak({
[](#%5F%5Fcodelineno-5-6)    language: 'en-US',
[](#%5F%5Fcodelineno-5-7)    pitch: 1.0,
[](#%5F%5Fcodelineno-5-8)    queueStrategy: QueueStrategy.Add,
[](#%5F%5Fcodelineno-5-9)    rate: 1.0,
[](#%5F%5Fcodelineno-5-10)    text: 'Hello, World!',
[](#%5F%5Fcodelineno-5-11)    voiceId: 'com.apple.ttsbundle.Samantha-compact',
[](#%5F%5Fcodelineno-5-12)    volume: 1.0,
[](#%5F%5Fcodelineno-5-13)  });
[](#%5F%5Fcodelineno-5-14)  // Wait for the utterance to finish
[](#%5F%5Fcodelineno-5-15)  await new Promise(resolve => {
[](#%5F%5Fcodelineno-5-16)    void SpeechSynthesis.addListener('end', event => {
[](#%5F%5Fcodelineno-5-17)      if (event.utteranceId === utteranceId) {
[](#%5F%5Fcodelineno-5-18)        resolve();
[](#%5F%5Fcodelineno-5-19)      }
[](#%5F%5Fcodelineno-5-20)    });
[](#%5F%5Fcodelineno-5-21)  });
[](#%5F%5Fcodelineno-5-22)};
`

### Synthesize speech to an audio file[¶](#synthesize-speech-to-an-audio-file "Permanent link")

Instead of speaking an utterance, you can synthesize it to an audio file, for example to play it later. The file is available as soon as the `end` event is emitted. Only available on Android and iOS:

`[](#%5F%5Fcodelineno-6-1)import { SpeechSynthesis, QueueStrategy } from '@capawesome-team/capacitor-speech-synthesis';
[](#%5F%5Fcodelineno-6-2)
[](#%5F%5Fcodelineno-6-3)const synthesizeToFile = async () => {
[](#%5F%5Fcodelineno-6-4)  // Add an utterance to the utterance queue to be synthesized to a file
[](#%5F%5Fcodelineno-6-5)  const { path, utteranceId } = await SpeechSynthesis.synthesizeToFile({
[](#%5F%5Fcodelineno-6-6)    language: 'en-US',
[](#%5F%5Fcodelineno-6-7)    pitch: 1.0,
[](#%5F%5Fcodelineno-6-8)    queueStrategy: QueueStrategy.Add,
[](#%5F%5Fcodelineno-6-9)    rate: 1.0,
[](#%5F%5Fcodelineno-6-10)    text: 'Hello, World!',
[](#%5F%5Fcodelineno-6-11)    voiceId: 'com.apple.ttsbundle.Samantha-compact',
[](#%5F%5Fcodelineno-6-12)    volume: 1.0,
[](#%5F%5Fcodelineno-6-13)  });
[](#%5F%5Fcodelineno-6-14)  // Wait for the utterance to finish
[](#%5F%5Fcodelineno-6-15)  await new Promise(resolve => {
[](#%5F%5Fcodelineno-6-16)    void SpeechSynthesis.addListener('end', event => {
[](#%5F%5Fcodelineno-6-17)      if (event.utteranceId === utteranceId) {
[](#%5F%5Fcodelineno-6-18)        resolve();
[](#%5F%5Fcodelineno-6-19)      }
[](#%5F%5Fcodelineno-6-20)    });
[](#%5F%5Fcodelineno-6-21)  });
[](#%5F%5Fcodelineno-6-22)  // Return the path to the synthesized audio file
[](#%5F%5Fcodelineno-6-23)  return path;
[](#%5F%5Fcodelineno-6-24)};
`

### Pause, resume, and cancel speech[¶](#pause-resume-and-cancel-speech "Permanent link")

Pause the speech immediately and resume it later, or remove all utterances from the utterance queue:

`[](#%5F%5Fcodelineno-7-1)import { SpeechSynthesis } from '@capawesome-team/capacitor-speech-synthesis';
[](#%5F%5Fcodelineno-7-2)
[](#%5F%5Fcodelineno-7-3)const pause = async () => {
[](#%5F%5Fcodelineno-7-4)  await SpeechSynthesis.pause();
[](#%5F%5Fcodelineno-7-5)};
[](#%5F%5Fcodelineno-7-6)
[](#%5F%5Fcodelineno-7-7)const resume = async () => {
[](#%5F%5Fcodelineno-7-8)  await SpeechSynthesis.resume();
[](#%5F%5Fcodelineno-7-9)};
[](#%5F%5Fcodelineno-7-10)
[](#%5F%5Fcodelineno-7-11)const cancel = async () => {
[](#%5F%5Fcodelineno-7-12)  await SpeechSynthesis.cancel();
[](#%5F%5Fcodelineno-7-13)};
`

### Check availability[¶](#check-availability "Permanent link")

Check whether speech synthesis is available on the current device and whether a specific language or voice is supported:

`[](#%5F%5Fcodelineno-8-1)import { SpeechSynthesis } from '@capawesome-team/capacitor-speech-synthesis';
[](#%5F%5Fcodelineno-8-2)
[](#%5F%5Fcodelineno-8-3)const isAvailable = async () => {
[](#%5F%5Fcodelineno-8-4)  const result = await SpeechSynthesis.isAvailable();
[](#%5F%5Fcodelineno-8-5)  return result.isAvailable;
[](#%5F%5Fcodelineno-8-6)};
[](#%5F%5Fcodelineno-8-7)
[](#%5F%5Fcodelineno-8-8)const isLanguageAvailable = async () => {
[](#%5F%5Fcodelineno-8-9)  const result = await SpeechSynthesis.isLanguageAvailable({ language: 'en-US' });
[](#%5F%5Fcodelineno-8-10)  return result.isAvailable;
[](#%5F%5Fcodelineno-8-11)};
[](#%5F%5Fcodelineno-8-12)
[](#%5F%5Fcodelineno-8-13)const isVoiceAvailable = async () => {
[](#%5F%5Fcodelineno-8-14)  const result = await SpeechSynthesis.isVoiceAvailable({ voiceId: 'com.apple.ttsbundle.Samantha-compact' });
[](#%5F%5Fcodelineno-8-15)  return result.isAvailable;
[](#%5F%5Fcodelineno-8-16)};
`

### Get the available languages and voices[¶](#get-the-available-languages-and-voices "Permanent link")

Retrieve the available languages as BCP-47 language tags and the available voices, for example to let the user pick a preferred voice:

`[](#%5F%5Fcodelineno-9-1)import { SpeechSynthesis } from '@capawesome-team/capacitor-speech-synthesis';
[](#%5F%5Fcodelineno-9-2)
[](#%5F%5Fcodelineno-9-3)const getLanguages = async () => {
[](#%5F%5Fcodelineno-9-4)  const result = await SpeechSynthesis.getLanguages();
[](#%5F%5Fcodelineno-9-5)  return result.languages;
[](#%5F%5Fcodelineno-9-6)};
[](#%5F%5Fcodelineno-9-7)
[](#%5F%5Fcodelineno-9-8)const getVoices = async () => {
[](#%5F%5Fcodelineno-9-9)  const result = await SpeechSynthesis.getVoices();
[](#%5F%5Fcodelineno-9-10)  return result.voices;
[](#%5F%5Fcodelineno-9-11)};
`

### Listen for speech synthesis events[¶](#listen-for-speech-synthesis-events "Permanent link")

React to the different stages of the speech synthesis, for example to highlight the word that is currently being spoken using the `boundary` event:

`[](#%5F%5Fcodelineno-10-1)import { SpeechSynthesis } from '@capawesome-team/capacitor-speech-synthesis';
[](#%5F%5Fcodelineno-10-2)
[](#%5F%5Fcodelineno-10-3)const addListeners = () => {
[](#%5F%5Fcodelineno-10-4)  SpeechSynthesis.addListener('boundary', (event) => {
[](#%5F%5Fcodelineno-10-5)    console.log('boundary', event);
[](#%5F%5Fcodelineno-10-6)  });
[](#%5F%5Fcodelineno-10-7)
[](#%5F%5Fcodelineno-10-8)  SpeechSynthesis.addListener('end', (event) => {
[](#%5F%5Fcodelineno-10-9)    console.log('end', event);
[](#%5F%5Fcodelineno-10-10)  });
[](#%5F%5Fcodelineno-10-11)
[](#%5F%5Fcodelineno-10-12)  SpeechSynthesis.addListener('error', (event) => {
[](#%5F%5Fcodelineno-10-13)    console.log('error', event);
[](#%5F%5Fcodelineno-10-14)  });
[](#%5F%5Fcodelineno-10-15)
[](#%5F%5Fcodelineno-10-16)  SpeechSynthesis.addListener('start', (event) => {
[](#%5F%5Fcodelineno-10-17)    console.log('start', event);
[](#%5F%5Fcodelineno-10-18)  });
[](#%5F%5Fcodelineno-10-19)};
`

### Remove all listeners[¶](#remove-all-listeners "Permanent link")

Remove all listeners for this plugin when they are no longer needed:

`[](#%5F%5Fcodelineno-11-1)import { SpeechSynthesis } from '@capawesome-team/capacitor-speech-synthesis';
[](#%5F%5Fcodelineno-11-2)
[](#%5F%5Fcodelineno-11-3)const removeAllListeners = async () => {
[](#%5F%5Fcodelineno-11-4)  await SpeechSynthesis.removeAllListeners();
[](#%5F%5Fcodelineno-11-5)};
`

## API[¶](#api "Permanent link")

* [activateAudioSession(...)](#activateaudiosession)
* [cancel()](#cancel)
* [deactivateAudioSession()](#deactivateaudiosession)
* [getLanguages()](#getlanguages)
* [getVoices()](#getvoices)
* [initialize()](#initialize)
* [isAvailable()](#isavailable)
* [isSpeaking()](#isspeaking)
* [isLanguageAvailable(...)](#islanguageavailable)
* [isVoiceAvailable(...)](#isvoiceavailable)
* [pause()](#pause)
* [resume()](#resume)
* [speak(...)](#speak)
* [synthesizeToFile(...)](#synthesizetofile)
* [addListener('boundary', ...)](#addlistenerboundary-)
* [addListener('end', ...)](#addlistenerend-)
* [addListener('error', ...)](#addlistenererror-)
* [addListener('start', ...)](#addlistenerstart-)
* [removeAllListeners()](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)
* [Enums](#enums)

### activateAudioSession(...)[¶](#activateaudiosession "Permanent link")

`[](#%5F%5Fcodelineno-12-1)activateAudioSession(options: ActivateAudioSessionOptions) => Promise<void>
`

Activate the audio session. This method is not mandatory. It can be used to set the audio session category before speaking.

Only available on iOS.

| Param       | Type                                                        |
| ----------- | ----------------------------------------------------------- |
| **options** | [ActivateAudioSessionOptions](#activateaudiosessionoptions) |

**Since:** 6.0.0

---

### cancel()[¶](#cancel "Permanent link")

`[](#%5F%5Fcodelineno-13-1)cancel() => Promise<void>
`

Remove all utterances from the utterance queue.

**Since:** 6.0.0

---

### deactivateAudioSession()[¶](#deactivateaudiosession "Permanent link")

`[](#%5F%5Fcodelineno-14-1)deactivateAudioSession() => Promise<void>
`

Deactivate the audio session.

Only available on iOS.

**Since:** 6.0.0

---

### getLanguages()[¶](#getlanguages "Permanent link")

`[](#%5F%5Fcodelineno-15-1)getLanguages() => Promise<GetLanguagesResult>
`

Get the available languages for speech synthesis.

**Returns:** `Promise<[GetLanguagesResult](#getlanguagesresult)>`

**Since:** 6.0.0

---

### getVoices()[¶](#getvoices "Permanent link")

`[](#%5F%5Fcodelineno-16-1)getVoices() => Promise<GetVoicesResult>
`

Get the available voices for speech synthesis.

**Returns:** `Promise<[GetVoicesResult](#getvoicesresult)>`

**Since:** 6.0.0

---

### initialize()[¶](#initialize "Permanent link")

`[](#%5F%5Fcodelineno-17-1)initialize() => Promise<void>
`

Initialize the plugin before any other method is called.

Use this method to warm up the speech synthesis engine. If this method is not called, the plugin will be automatically initialized on the first call to any other method.

Only available on Android and iOS.

**Since:** 6.0.0

---

### isAvailable()[¶](#isavailable "Permanent link")

`[](#%5F%5Fcodelineno-18-1)isAvailable() => Promise<IsAvailableResult>
`

Check if speech synthesis is available on the current device.

**Returns:** `Promise<[IsAvailableResult](#isavailableresult)>`

**Since:** 6.0.0

---

### isSpeaking()[¶](#isspeaking "Permanent link")

`[](#%5F%5Fcodelineno-19-1)isSpeaking() => Promise<IsSpeakingResult>
`

Check if speech synthesis is currently speaking.

**Returns:** `Promise<[IsSpeakingResult](#isspeakingresult)>`

**Since:** 6.0.0

---

### isLanguageAvailable(...)[¶](#islanguageavailable "Permanent link")

`[](#%5F%5Fcodelineno-20-1)isLanguageAvailable(options: IsLanguageAvailableOption) => Promise<IsLanguageAvailableResult>
`

Check if a language is available for speech synthesis.

| Param       | Type                                                    |
| ----------- | ------------------------------------------------------- |
| **options** | [IsLanguageAvailableOption](#islanguageavailableoption) |

**Returns:** `Promise<[IsLanguageAvailableResult](#islanguageavailableresult)>`

**Since:** 6.0.0

---

### isVoiceAvailable(...)[¶](#isvoiceavailable "Permanent link")

`[](#%5F%5Fcodelineno-21-1)isVoiceAvailable(options: IsVoiceAvailableOption) => Promise<IsVoiceAvailableResult>
`

Check if a voice is available for speech synthesis.

| Param       | Type                                              |
| ----------- | ------------------------------------------------- |
| **options** | [IsVoiceAvailableOption](#isvoiceavailableoption) |

**Returns:** `Promise<[IsVoiceAvailableResult](#isvoiceavailableresult)>`

**Since:** 6.0.0

---

### pause()[¶](#pause "Permanent link")

`[](#%5F%5Fcodelineno-22-1)pause() => Promise<void>
`

Pause speech immediately.

**Since:** 7.2.0

---

### resume()[¶](#resume "Permanent link")

`[](#%5F%5Fcodelineno-23-1)resume() => Promise<void>
`

Resume speech.

**Since:** 7.2.0

---

### speak(...)[¶](#speak "Permanent link")

`[](#%5F%5Fcodelineno-24-1)speak(options: SpeakOptions) => Promise<SpeakResult>
`

Add an utterance to the utterance queue to be spoken.

The `end` event will be emitted when the utterance has finished.

| Param       | Type                          |
| ----------- | ----------------------------- |
| **options** | [SpeakOptions](#speakoptions) |

**Returns:** `Promise<[SpeakResult](#speakresult)>`

**Since:** 6.0.0

---

### synthesizeToFile(...)[¶](#synthesizetofile "Permanent link")

`[](#%5F%5Fcodelineno-25-1)synthesizeToFile(options: SynthesizeToFileOptions) => Promise<SynthesizeToFileResult>
`

Add an utterance to the utterance queue to be synthesized to a file.

The `end` event will be emitted when the utterance has finished.

Only available on Android and iOS.

| Param       | Type                          |
| ----------- | ----------------------------- |
| **options** | [SpeakOptions](#speakoptions) |

**Returns:** `Promise<[SynthesizeToFileResult](#synthesizetofileresult)>`

**Since:** 7.1.0

---

### addListener('boundary', ...)[¶](#addlistenerboundary "Permanent link")

`[](#%5F%5Fcodelineno-26-1)addListener(eventName: 'boundary', listenerFunc: (event: BoundaryEvent) => void) => Promise<PluginListenerHandle>
`

Called hen the spoken utterance reaches a word boundary.

| Param            | Type                                             |
| ---------------- | ------------------------------------------------ |
| **eventName**    | 'boundary'                                       |
| **listenerFunc** | (event: [BoundaryEvent](#boundaryevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 6.0.0

---

### addListener('end', ...)[¶](#addlistenerend "Permanent link")

`[](#%5F%5Fcodelineno-27-1)addListener(eventName: 'end', listenerFunc: (event: EndEvent) => void) => Promise<PluginListenerHandle>
`

Called when the spoken utterance has finished.

| Param            | Type                                   |
| ---------------- | -------------------------------------- |
| **eventName**    | 'end'                                  |
| **listenerFunc** | (event: [EndEvent](#endevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 6.0.0

---

### addListener('error', ...)[¶](#addlistenererror "Permanent link")

`[](#%5F%5Fcodelineno-28-1)addListener(eventName: 'error', listenerFunc: (event: ErrorEvent) => void) => Promise<PluginListenerHandle>
`

Called when an error occurs during speech synthesis.

| Param            | Type                                       |
| ---------------- | ------------------------------------------ |
| **eventName**    | 'error'                                    |
| **listenerFunc** | (event: [ErrorEvent](#errorevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 6.0.0

---

### addListener('start', ...)[¶](#addlistenerstart "Permanent link")

`[](#%5F%5Fcodelineno-29-1)addListener(eventName: 'start', listenerFunc: (event: StartEvent) => void) => Promise<PluginListenerHandle>
`

Called when the spoken utterance has started.

| Param            | Type                                       |
| ---------------- | ------------------------------------------ |
| **eventName**    | 'start'                                    |
| **listenerFunc** | (event: [StartEvent](#startevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 6.0.0

---

### removeAllListeners()[¶](#removealllisteners "Permanent link")

`[](#%5F%5Fcodelineno-30-1)removeAllListeners() => Promise<void>
`

Remove all listeners for the plugin.

**Since:** 6.0.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### ActivateAudioSessionOptions[¶](#activateaudiosessionoptions "Permanent link")

| Prop         | Type                                          | Description                        | Since |
| ------------ | --------------------------------------------- | ---------------------------------- | ----- |
| **category** | [AudioSessionCategory](#audiosessioncategory) | The audio session category to set. | 6.0.0 |

#### GetLanguagesResult[¶](#getlanguagesresult "Permanent link")

| Prop          | Type       | Description                                     | Since |
| ------------- | ---------- | ----------------------------------------------- | ----- |
| **languages** | string\[\] | The available languages as BC-47 language tags. | 6.0.0 |

#### GetVoicesResult[¶](#getvoicesresult "Permanent link")

| Prop       | Type      | Description           | Since |
| ---------- | --------- | --------------------- | ----- |
| **voices** | Voice\[\] | The available voices. | 6.0.0 |

#### Voice[¶](#voice "Permanent link")

| Prop                            | Type               | Description                                                           | Since |
| ------------------------------- | ------------------ | --------------------------------------------------------------------- | ----- |
| **default**                     | boolean            | Whether or not the voice is the default voice. Only available on Web. | 6.0.0 |
| **gender**                      | 'female' \| 'male' | The gender of the voice. Only available on iOS.                       | 6.0.0 |
| **id**                          | string             | The identifier of the voice.                                          | 6.0.0 |
| **isNetworkConnectionRequired** | boolean            | Whether or not the voice is available via a local or remote service.  | 6.0.0 |
| **language**                    | string             | The BC-47 language tag for the language of the voice.                 | 6.0.0 |
| **name**                        | string             | The name of the voice.                                                | 6.0.0 |

#### IsAvailableResult[¶](#isavailableresult "Permanent link")

| Prop            | Type    | Description                                                         | Since |
| --------------- | ------- | ------------------------------------------------------------------- | ----- |
| **isAvailable** | boolean | Whether or not speech synthesis is available on the current device. | 6.0.0 |

#### IsSpeakingResult[¶](#isspeakingresult "Permanent link")

| Prop           | Type    | Description                                            | Since |
| -------------- | ------- | ------------------------------------------------------ | ----- |
| **isSpeaking** | boolean | Whether or not an utterance is currently being spoken. | 6.0.0 |

#### IsLanguageAvailableResult[¶](#islanguageavailableresult "Permanent link")

| Prop            | Type    | Description                                                    | Since |
| --------------- | ------- | -------------------------------------------------------------- | ----- |
| **isAvailable** | boolean | Whether or not the language is available for speech synthesis. | 6.0.0 |

#### IsLanguageAvailableOption[¶](#islanguageavailableoption "Permanent link")

| Prop         | Type   | Description                                       | Since |
| ------------ | ------ | ------------------------------------------------- | ----- |
| **language** | string | The BC-47 language tag for the language to check. | 6.0.0 |

#### IsVoiceAvailableResult[¶](#isvoiceavailableresult "Permanent link")

| Prop            | Type    | Description                                                 | Since |
| --------------- | ------- | ----------------------------------------------------------- | ----- |
| **isAvailable** | boolean | Whether or not the voice is available for speech synthesis. | 6.0.0 |

#### IsVoiceAvailableOption[¶](#isvoiceavailableoption "Permanent link")

| Prop        | Type   | Description                           | Since |
| ----------- | ------ | ------------------------------------- | ----- |
| **voiceId** | string | The identifier of the voice to check. | 6.0.0 |

#### SpeakResult[¶](#speakresult "Permanent link")

| Prop            | Type   | Description                                           | Since |
| --------------- | ------ | ----------------------------------------------------- | ----- |
| **utteranceId** | string | The identifier of the utterance that is being spoken. | 6.0.0 |

#### SpeakOptions[¶](#speakoptions "Permanent link")

| Prop                     | Type                                          | Description                                                                                                                                                                                                                                          | Default                          | Since |
| ------------------------ | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ----- |
| **audioSessionCategory** | [AudioSessionCategory](#audiosessioncategory) | The audio session category to use for speech synthesis. The audio session will be automatically activated with this category when speech starts and deactivated when speech ends, restoring the previous audio session state. Only available on iOS. | AudioSessionCategory.SoloAmbient | 8.0.0 |
| **language**             | string                                        | The BC-47 language tag for the language to use for speech synthesis. On **iOS**, this option is only used when the voiceId option is not provided.                                                                                                   |                                  | 6.0.0 |
| **pitch**                | number                                        | The pitch that the utterance will be spoken at.                                                                                                                                                                                                      | 1.0                              | 6.0.0 |
| **queueStrategy**        | [QueueStrategy](#queuestrategy)               | The queue strategy to use for the utterance.                                                                                                                                                                                                         | QueueStrategy.Add                | 6.0.0 |
| **rate**                 | number                                        | The speed at which the utterance will be spoken at.                                                                                                                                                                                                  | 1.0                              | 6.0.0 |
| **text**                 | string                                        | The text that will be synthesized when the utterance is spoken.                                                                                                                                                                                      |                                  | 6.0.0 |
| **voiceId**              | string                                        | The identifier of the voice to use for speech synthesis.                                                                                                                                                                                             |                                  | 6.0.0 |
| **volume**               | number                                        | The volume that the utterance will be spoken at.                                                                                                                                                                                                     | 1.0                              | 6.0.0 |

#### SynthesizeToFileResult[¶](#synthesizetofileresult "Permanent link")

| Prop     | Type   | Description                                                                                                                                               | Since |
| -------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **path** | string | The path to which the synthesized audio file will be saved. The file is available as soon as the end event is emitted. Only available on Android and iOS. | 7.1.0 |

#### PluginListenerHandle[¶](#pluginlistenerhandle "Permanent link")

| Prop       | Type                |
| ---------- | ------------------- |
| **remove** | () => Promise<void> |

#### BoundaryEvent[¶](#boundaryevent "Permanent link")

| Prop            | Type   | Description                                           | Since |
| --------------- | ------ | ----------------------------------------------------- | ----- |
| **endIndex**    | number | The index of the last character in the word.          | 6.0.0 |
| **startIndex**  | number | The index of the first character in the word.         | 6.0.0 |
| **utteranceId** | string | The identifier of the utterance that is being spoken. | 6.0.0 |
| **word**        | string | The word that was spoken.                             | 6.0.0 |

#### EndEvent[¶](#endevent "Permanent link")

| Prop            | Type   | Description                                        | Since |
| --------------- | ------ | -------------------------------------------------- | ----- |
| **utteranceId** | string | The identifier of the utterance that has finished. | 6.0.0 |

#### ErrorEvent[¶](#errorevent "Permanent link")

| Prop            | Type   | Description                                            | Since |
| --------------- | ------ | ------------------------------------------------------ | ----- |
| **message**     | string | The error message.                                     | 6.0.0 |
| **utteranceId** | string | The identifier of the utterance that caused the error. | 6.0.0 |

#### StartEvent[¶](#startevent "Permanent link")

| Prop            | Type   | Description                                       | Since |
| --------------- | ------ | ------------------------------------------------- | ----- |
| **utteranceId** | string | The identifier of the utterance that has started. | 6.0.0 |

### Type Aliases[¶](#type-aliases "Permanent link")

#### SynthesizeToFileOptions[¶](#synthesizetofileoptions "Permanent link")

`[SpeakOptions](#speakoptions)`

### Enums[¶](#enums "Permanent link")

#### AudioSessionCategory[¶](#audiosessioncategory "Permanent link")

| Members           | Value               | Description                                                                                                                                         | Since |
| ----------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **Ambient**       | 'AMBIENT'           | The audio session category for ambient sound. Audio from other apps mixes with your audio. Screen locking and the Silent switch silence your audio. | 6.0.0 |
| **MultiRoute**    | 'MULTI\_ROUTE'      | The audio session category for routing distinct streams to different outputs.                                                                       | 8.0.0 |
| **PlayAndRecord** | 'PLAY\_AND\_RECORD' | The audio session category for recording or playback.                                                                                               | 8.0.0 |
| **Playback**      | 'PLAYBACK'          | The audio session category for playback. App audio continues with the Silent switch set to silent or when the screen locks.                         | 6.0.0 |
| **Record**        | 'RECORD'            | The audio session category for recording.                                                                                                           | 8.0.0 |
| **SoloAmbient**   | 'SOLO\_AMBIENT'     | The default audio session category. Audio from other apps is silenced. Screen locking and the Silent switch silence your audio.                     | 8.0.0 |

#### QueueStrategy[¶](#queuestrategy "Permanent link")

| Members   | Value | Description                                                          | Since |
| --------- | ----- | -------------------------------------------------------------------- | ----- |
| **Add**   | 0     | Add the utterance to the end of the queue.                           | 6.0.0 |
| **Flush** | 1     | Flush the queue and add the utterance to the beginning of the queue. | 6.0.0 |

## FAQ[¶](#faq "Permanent link")

### How do I know when an utterance has finished?[¶](#how-do-i-know-when-an-utterance-has-finished "Permanent link")

The `speak(...)` and `synthesizeToFile(...)` methods resolve as soon as the utterance has been added to the utterance queue, not when it has finished. To be notified when the utterance has finished, add a listener for the `end` event and compare the `utteranceId` of the event with the one returned by the method, as shown in the [usage example](#speak-a-text) above.

### Why is no audio played when my iPhone is in silent mode?[¶](#why-is-no-audio-played-when-my-iphone-is-in-silent-mode "Permanent link")

By default, the plugin uses the `SoloAmbient` audio session category on iOS, which is silenced by the Silent switch and when the screen locks. If the speech should continue to play in silent mode or when the screen locks, set the `audioSessionCategory` option of the `speak(...)` method to `AudioSessionCategory.Playback`.

### Can I save the synthesized speech as an audio file?[¶](#can-i-save-the-synthesized-speech-as-an-audio-file "Permanent link")

Yes, use the `synthesizeToFile(...)` method to synthesize an utterance to an audio file instead of speaking it. The result contains the path to which the file is saved, and the file is available as soon as the `end` event is emitted. This method is only available on Android and iOS.

### How do I use a specific voice?[¶](#how-do-i-use-a-specific-voice "Permanent link")

First, retrieve the available voices using the `getVoices()` method. Then pass the identifier of the desired voice as the `voiceId` option to the `speak(...)` method. Note that on iOS, the `language` option is only used when the `voiceId` option is not provided.

### What is the difference between the `Add` and `Flush` queue strategies?[¶](#what-is-the-difference-between-the-add-and-flush-queue-strategies "Permanent link")

The `QueueStrategy.Add` strategy adds the utterance to the end of the utterance queue, so it is spoken after all previously queued utterances. The `QueueStrategy.Flush` strategy flushes the queue and adds the utterance to the beginning of the queue, so it is spoken as soon as possible.

### Can I use this plugin with Ionic, React, Vue or Angular?[¶](#can-i-use-this-plugin-with-ionic-react-vue-or-angular "Permanent link")

Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.

## Related Plugins[¶](#related-plugins "Permanent link")

* [Speech Recognition](https://capawesome.io/docs/sdks/capacitor/speech-recognition/): Transcribe speech into text (also known as speech-to-text).
* [Audio Player](https://capawesome.io/docs/sdks/capacitor/audio-player/): Play audio with background support.
* [Audio Recorder](https://capawesome.io/docs/sdks/capacitor/audio-recorder/): Record audio using the device's microphone.

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/speech-synthesis/CHANGELOG.md).

## Breaking Changes[¶](#breaking-changes "Permanent link")

See [BREAKING.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/speech-synthesis/BREAKING.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/speech-synthesis/LICENSE).

July 8, 2026 

Back to top

```json
{"@context": "https://schema.org", "@graph": [{"@type": "TechArticle", "@id": "https://capawesome.io/docs/sdks/capacitor/speech-synthesis/#article", "headline": "Capacitor Speech Synthesis Plugin for Android, iOS & Web", "name": "Capacitor Speech Synthesis Plugin for Android, iOS & Web", "description": "Capacitor plugin for synthesizing speech from text (also known as text-to-speech) with advanced features like voice selection, pitch, and rate control.", "inLanguage": "en", "url": "https://capawesome.io/docs/sdks/capacitor/speech-synthesis/", "mainEntityOfPage": "https://capawesome.io/docs/sdks/capacitor/speech-synthesis/", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "about": {"@id": "https://capawesome.io/docs/sdks/capacitor/speech-synthesis/#software"}}, {"@type": "SoftwareSourceCode", "@id": "https://capawesome.io/docs/sdks/capacitor/speech-synthesis/#software", "name": "Capacitor Speech Synthesis Plugin for Android, iOS & Web", "description": "Capacitor plugin for synthesizing speech from text (also known as text-to-speech) with advanced features like voice selection, pitch, and rate control.", "url": "https://capawesome.io/docs/sdks/capacitor/speech-synthesis/", "programmingLanguage": "TypeScript", "runtimePlatform": "Capacitor", "codeRepository": "https://github.com/capawesome-team", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}}]}
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "How do I know when an utterance has finished?", "acceptedAnswer": {"@type": "Answer", "text": "The speak(...) and synthesizeToFile(...) methods resolve as soon as the utterance has been added to the utterance queue, not when it has finished. To be notified when the utterance has finished, add a listener for the end event and compare the utteranceId of the event with the one returned by the method, as shown in the usage example above."}}, {"@type": "Question", "name": "Why is no audio played when my iPhone is in silent mode?", "acceptedAnswer": {"@type": "Answer", "text": "By default, the plugin uses the SoloAmbient audio session category on iOS, which is silenced by the Silent switch and when the screen locks. If the speech should continue to play in silent mode or when the screen locks, set the audioSessionCategory option of the speak(...) method to AudioSessionCategory.Playback."}}, {"@type": "Question", "name": "Can I save the synthesized speech as an audio file?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, use the synthesizeToFile(...) method to synthesize an utterance to an audio file instead of speaking it. The result contains the path to which the file is saved, and the file is available as soon as the end event is emitted. This method is only available on Android and iOS."}}, {"@type": "Question", "name": "How do I use a specific voice?", "acceptedAnswer": {"@type": "Answer", "text": "First, retrieve the available voices using the getVoices() method. Then pass the identifier of the desired voice as the voiceId option to the speak(...) method. Note that on iOS, the language option is only used when the voiceId option is not provided."}}, {"@type": "Question", "name": "What is the difference between the Add and Flush queue strategies?", "acceptedAnswer": {"@type": "Answer", "text": "The QueueStrategy.Add strategy adds the utterance to the end of the utterance queue, so it is spoken after all previously queued utterances. The QueueStrategy.Flush strategy flushes the queue and adds the utterance to the beginning of the queue, so it is spoken as soon as possible."}}, {"@type": "Question", "name": "Can I use this plugin with Ionic, React, Vue or Angular?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects."}}], "url": "https://capawesome.io/docs/sdks/capacitor/speech-synthesis/"}
```
