Skip to content

@capgo/capacitor-speech-synthesis

Speech Synthesis Plugin for synthesizing speech from text.

Speech Synthesis Plugin for synthesizing speech from text.

  • 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.
MethodDescription
speakSpeaks the given text with specified options. The utterance is added to the speech queue.
synthesizeToFileSynthesizes speech to an audio file (Android/iOS only). Returns the file path where the audio was saved.
cancelCancels all queued utterances and stops current speech.
pausePauses speech immediately.
resumeResumes paused speech.
isSpeakingChecks if speech synthesis is currently speaking.
isAvailableChecks if speech synthesis is available on the device.
getVoicesGets all available voices.
getLanguagesGets all available languages.
isLanguageAvailableChecks if a specific language is available.
isVoiceAvailableChecks if a specific voice is available.
initializeInitializes the speech synthesis engine (iOS optimization). This can reduce latency for the first speech request.
activateAudioSessionActivates the audio session with a specific category (iOS only).
deactivateAudioSessionDeactivates the audio session (iOS only).
getPluginVersionGets the native plugin version.
addListenerListens for when an utterance starts speaking.
addListenerListens for when an utterance finishes speaking.
addListenerListens for word boundaries during speech.
addListenerListens for synthesis errors.
removeAllListenersRemoves all event listeners.

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.