---
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/plugins/speech-synthesis.png
---

[ Skip to content](#capawesome-teamcapacitor-speech-synthesis) 

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* Speech Synthesis [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Configuration ](#configuration)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Enums ](#enums)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

* [  Configuration ](#configuration)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Enums ](#enums)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)

# @capawesome-team/capacitor-speech-synthesis[¶](#capawesome-teamcapacitor-speech-synthesis "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")

We are proud to offer one of the most complete and feature-rich Capacitor plugins for speech synthesis. 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/plugins/audio-player/), [Audio Recorder](https://capawesome.io/docs/plugins/audio-recorder/) and [Speech Recognition](https://capawesome.io/docs/plugins/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!

## 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/).

## 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")

`[](#%5F%5Fcodelineno-5-1)import { SpeechSynthesis, AudioSessionCategory, 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)};
[](#%5F%5Fcodelineno-5-23)
[](#%5F%5Fcodelineno-5-24)const synthesizeToFile = async () => {
[](#%5F%5Fcodelineno-5-25)  // Add an utterance to the utterance queue to be synthesized to a file
[](#%5F%5Fcodelineno-5-26)  const { path, utteranceId } = await SpeechSynthesis.synthesizeToFile({
[](#%5F%5Fcodelineno-5-27)    language: 'en-US',
[](#%5F%5Fcodelineno-5-28)    pitch: 1.0,
[](#%5F%5Fcodelineno-5-29)    queueStrategy: QueueStrategy.Add,
[](#%5F%5Fcodelineno-5-30)    rate: 1.0,
[](#%5F%5Fcodelineno-5-31)    text: 'Hello, World!',
[](#%5F%5Fcodelineno-5-32)    voiceId: 'com.apple.ttsbundle.Samantha-compact',
[](#%5F%5Fcodelineno-5-33)    volume: 1.0,
[](#%5F%5Fcodelineno-5-34)  });
[](#%5F%5Fcodelineno-5-35)  // Wait for the utterance to finish
[](#%5F%5Fcodelineno-5-36)  await new Promise(resolve => {
[](#%5F%5Fcodelineno-5-37)    void SpeechSynthesis.addListener('end', event => {
[](#%5F%5Fcodelineno-5-38)      if (event.utteranceId === utteranceId) {
[](#%5F%5Fcodelineno-5-39)        resolve();
[](#%5F%5Fcodelineno-5-40)      }
[](#%5F%5Fcodelineno-5-41)    });
[](#%5F%5Fcodelineno-5-42)  });
[](#%5F%5Fcodelineno-5-43)  // Return the path to the synthesized audio file
[](#%5F%5Fcodelineno-5-44)  return path;
[](#%5F%5Fcodelineno-5-45)};
[](#%5F%5Fcodelineno-5-46)
[](#%5F%5Fcodelineno-5-47)const cancel = async () => {
[](#%5F%5Fcodelineno-5-48)  await SpeechSynthesis.cancel();
[](#%5F%5Fcodelineno-5-49)};
[](#%5F%5Fcodelineno-5-50)
[](#%5F%5Fcodelineno-5-51)const pause = async () => {
[](#%5F%5Fcodelineno-5-52)  await SpeechSynthesis.pause();
[](#%5F%5Fcodelineno-5-53)};
[](#%5F%5Fcodelineno-5-54)
[](#%5F%5Fcodelineno-5-55)const resume = async () => {
[](#%5F%5Fcodelineno-5-56)  await SpeechSynthesis.resume();
[](#%5F%5Fcodelineno-5-57)};
[](#%5F%5Fcodelineno-5-58)
[](#%5F%5Fcodelineno-5-59)const isAvailable = async () => {
[](#%5F%5Fcodelineno-5-60)  const result = await SpeechSynthesis.isAvailable();
[](#%5F%5Fcodelineno-5-61)  return result.isAvailable;
[](#%5F%5Fcodelineno-5-62)};
[](#%5F%5Fcodelineno-5-63)
[](#%5F%5Fcodelineno-5-64)const isLanguageAvailable = async () => {
[](#%5F%5Fcodelineno-5-65)  const result = await SpeechSynthesis.isLanguageAvailable({ language: 'en-US' });
[](#%5F%5Fcodelineno-5-66)  return result.isAvailable;
[](#%5F%5Fcodelineno-5-67)};
[](#%5F%5Fcodelineno-5-68)
[](#%5F%5Fcodelineno-5-69)const isVoiceAvailable = async () => {
[](#%5F%5Fcodelineno-5-70)  const result = await SpeechSynthesis.isVoiceAvailable({ voiceId: 'com.apple.ttsbundle.Samantha-compact' });
[](#%5F%5Fcodelineno-5-71)  return result.isAvailable;
[](#%5F%5Fcodelineno-5-72)};
[](#%5F%5Fcodelineno-5-73)
[](#%5F%5Fcodelineno-5-74)const getLanguages = async () => {
[](#%5F%5Fcodelineno-5-75)  const result = await SpeechSynthesis.getLanguages();
[](#%5F%5Fcodelineno-5-76)  return result.languages;
[](#%5F%5Fcodelineno-5-77)};
[](#%5F%5Fcodelineno-5-78)
[](#%5F%5Fcodelineno-5-79)const getVoices = async () => {
[](#%5F%5Fcodelineno-5-80)  const result = await SpeechSynthesis.getVoices();
[](#%5F%5Fcodelineno-5-81)  return result.voices;
[](#%5F%5Fcodelineno-5-82)};
[](#%5F%5Fcodelineno-5-83)
[](#%5F%5Fcodelineno-5-84)const addListeners = () => {
[](#%5F%5Fcodelineno-5-85)  SpeechSynthesis.addListener('boundary', (event) => {
[](#%5F%5Fcodelineno-5-86)    console.log('boundary', event);
[](#%5F%5Fcodelineno-5-87)  });
[](#%5F%5Fcodelineno-5-88)
[](#%5F%5Fcodelineno-5-89)  SpeechSynthesis.addListener('end', (event) => {
[](#%5F%5Fcodelineno-5-90)    console.log('end', event);
[](#%5F%5Fcodelineno-5-91)  });
[](#%5F%5Fcodelineno-5-92)
[](#%5F%5Fcodelineno-5-93)  SpeechSynthesis.addListener('error', (event) => {
[](#%5F%5Fcodelineno-5-94)    console.log('error', event);
[](#%5F%5Fcodelineno-5-95)  });
[](#%5F%5Fcodelineno-5-96)
[](#%5F%5Fcodelineno-5-97)  SpeechSynthesis.addListener('start', (event) => {
[](#%5F%5Fcodelineno-5-98)    console.log('start', event);
[](#%5F%5Fcodelineno-5-99)  });
[](#%5F%5Fcodelineno-5-100)};
[](#%5F%5Fcodelineno-5-101)
[](#%5F%5Fcodelineno-5-102)const removeAllListeners = async () => {
[](#%5F%5Fcodelineno-5-103)  await SpeechSynthesis.removeAllListeners();
[](#%5F%5Fcodelineno-5-104)};
`

## 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-6-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-7-1)cancel() => Promise<void>
`

Remove all utterances from the utterance queue.

**Since:** 6.0.0

---

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

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

Deactivate the audio session.

Only available on iOS.

**Since:** 6.0.0

---

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

`[](#%5F%5Fcodelineno-9-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-10-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-11-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-12-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-13-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-14-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-15-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-16-1)pause() => Promise<void>
`

Pause speech immediately.

**Since:** 7.2.0

---

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

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

Resume speech.

**Since:** 7.2.0

---

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

`[](#%5F%5Fcodelineno-18-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-19-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-20-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-21-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-22-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-23-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-24-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 |

## 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).

May 17, 2026 

 Back to top 