@capgo/capacitor-speech-synthesis
Speech Synthesis Plugin for synthesizing speech from text.
Overview
Section titled “Overview”Speech Synthesis Plugin for synthesizing speech from text.
Core Capabilities
Section titled “Core Capabilities”speak- Speaks the given text with specified options. The utterance is added to the speech queue.synthesizeToFile- Synthesizes speech to an audio file (Android/iOS only). Returns the file path where the audio was saved.cancel- Cancels all queued utterances and stops current speech.pause- Pauses speech immediately.
Public API
Section titled “Public API”| Method | Description |
|---|---|
speak | Speaks the given text with specified options. The utterance is added to the speech queue. |
synthesizeToFile | Synthesizes speech to an audio file (Android/iOS only). Returns the file path where the audio was saved. |
cancel | Cancels all queued utterances and stops current speech. |
pause | Pauses speech immediately. |
resume | Resumes paused speech. |
isSpeaking | Checks if speech synthesis is currently speaking. |
isAvailable | Checks if speech synthesis is available on the device. |
getVoices | Gets all available voices. |
getLanguages | Gets all available languages. |
isLanguageAvailable | Checks if a specific language is available. |
isVoiceAvailable | Checks if a specific voice is available. |
initialize | Initializes the speech synthesis engine (iOS optimization). This can reduce latency for the first speech request. |
activateAudioSession | Activates the audio session with a specific category (iOS only). |
deactivateAudioSession | Deactivates the audio session (iOS only). |
getPluginVersion | Gets the native plugin version. |
addListener | Listens for when an utterance starts speaking. |
addListener | Listens for when an utterance finishes speaking. |
addListener | Listens for word boundaries during speech. |
addListener | Listens for synthesis errors. |
removeAllListeners | Removes all event listeners. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-speech-synthesis.