@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.
Keep going from @capgo/capacitor-speech-synthesis
Section titled “Keep going from @capgo/capacitor-speech-synthesis”If you are using @capgo/capacitor-speech-synthesis to plan native plugin work, connect it with Using @capgo/capacitor-speech-synthesis for the native capability in Using @capgo/capacitor-speech-synthesis, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, and Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives.