{"id":13514815,"url":"https://github.com/capacitor-community/text-to-speech","last_synced_at":"2025-05-16T05:00:19.272Z","repository":{"id":38284693,"uuid":"267676061","full_name":"capacitor-community/text-to-speech","owner":"capacitor-community","description":"⚡️ Capacitor plugin for synthesizing speech from text.","archived":false,"fork":false,"pushed_at":"2025-03-12T07:39:53.000Z","size":1132,"stargazers_count":112,"open_issues_count":18,"forks_count":33,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-15T01:44:01.026Z","etag":null,"topics":["android","capacitor","capacitor-community","capacitor-plugin","ios","text-to-speech","tts"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capacitor-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-28T19:17:41.000Z","updated_at":"2025-05-14T04:29:07.000Z","dependencies_parsed_at":"2024-04-16T07:28:20.640Z","dependency_job_id":"ed45c8b5-0144-4dcf-a31e-3f92144650f7","html_url":"https://github.com/capacitor-community/text-to-speech","commit_stats":{"total_commits":160,"total_committers":14,"mean_commits":"11.428571428571429","dds":0.4375,"last_synced_commit":"08cf2eb14b865fe922a122a089bfe0f5293b16be"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":"capacitor-community/.github","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capacitor-community%2Ftext-to-speech","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capacitor-community%2Ftext-to-speech/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capacitor-community%2Ftext-to-speech/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capacitor-community%2Ftext-to-speech/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capacitor-community","download_url":"https://codeload.github.com/capacitor-community/text-to-speech/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471028,"owners_count":22076582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","capacitor","capacitor-community","capacitor-plugin","ios","text-to-speech","tts"],"created_at":"2024-08-01T05:01:02.192Z","updated_at":"2025-05-16T05:00:18.920Z","avatar_url":"https://github.com/capacitor-community.png","language":"Java","funding_links":[],"categories":["Plugins","Java","Community plugins"],"sub_categories":["Community Plugins"],"readme":"\u003cp align=\"center\"\u003e\u003cbr\u003e\u003cimg src=\"https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png\" width=\"128\" height=\"128\" /\u003e\u003c/p\u003e\n\u003ch3 align=\"center\"\u003eText to Speech\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\u003cstrong\u003e\u003ccode\u003e@capacitor-community/text-to-speech\u003c/code\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  Capacitor community plugin for synthesizing speech from text.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/maintenance/yes/2025?style=flat-square\" /\u003e\n  \u003ca href=\"https://github.com/capacitor-community/text-to-speech/actions?query=workflow%3A%22CI%22\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/capacitor-community/text-to-speech/ci.yml?branch=master\u0026style=flat-square\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@capacitor-community/text-to-speech\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/@capacitor-community/text-to-speech?style=flat-square\" /\u003e\u003c/a\u003e\n\u003cbr\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@capacitor-community/text-to-speech\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/@capacitor-community/text-to-speech?style=flat-square\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@capacitor-community/text-to-speech\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@capacitor-community/text-to-speech?style=flat-square\" /\u003e\u003c/a\u003e\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n\u003ca href=\"#contributors-\"\u003e\u003cimg src=\"https://img.shields.io/badge/all%20contributors-1-orange?style=flat-square\" /\u003e\u003c/a\u003e\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\u003c/p\u003e\n\n## Maintainers\n\n| Maintainer | GitHub                                    | Social                                        |\n| ---------- | ----------------------------------------- | --------------------------------------------- |\n| Robin Genz | [robingenz](https://github.com/robingenz) | [@robin_genz](https://twitter.com/robin_genz) |\n\n## Installation\n\n```\nnpm install @capacitor-community/text-to-speech\nnpx cap sync\n```\n\n## Configuration\n\nNo configuration required for this plugin.\n\n## Demo\n\nA working example can be found here: [robingenz/capacitor-plugin-demo](https://github.com/robingenz/capacitor-plugin-demo)\n\n## Usage\n\n```typescript\nimport { TextToSpeech } from '@capacitor-community/text-to-speech';\n\nconst speak = async () =\u003e {\n  await TextToSpeech.speak({\n    text: 'This is a sample text.',\n    lang: 'en-US',\n    rate: 1.0,\n    pitch: 1.0,\n    volume: 1.0,\n    category: 'ambient',\n    queueStrategy: 1\n  });\n};\n\nconst stop = async () =\u003e {\n  await TextToSpeech.stop();\n};\n\nconst getSupportedLanguages = async () =\u003e {\n  const languages = await TextToSpeech.getSupportedLanguages();\n};\n\nconst getSupportedVoices = async () =\u003e {\n  const voices = await TextToSpeech.getSupportedVoices();\n};\n\nconst isLanguageSupported = async (lang: string) =\u003e {\n  const isSupported = await TextToSpeech.isLanguageSupported({ lang });\n};\n```\n\n## API\n\n\u003cdocgen-index\u003e\n\n* [`speak(...)`](#speak)\n* [`stop()`](#stop)\n* [`getSupportedLanguages()`](#getsupportedlanguages)\n* [`getSupportedVoices()`](#getsupportedvoices)\n* [`isLanguageSupported(...)`](#islanguagesupported)\n* [`openInstall()`](#openinstall)\n* [`addListener('onRangeStart', ...)`](#addlisteneronrangestart-)\n* [Interfaces](#interfaces)\n* [Enums](#enums)\n\n\u003c/docgen-index\u003e\n\n\u003cdocgen-api\u003e\n\u003c!--Update the source file JSDoc comments and rerun docgen to update the docs below--\u003e\n\n### speak(...)\n\n```typescript\nspeak(options: TTSOptions) =\u003e Promise\u003cvoid\u003e\n```\n\nStarts the TTS engine and plays the desired text.\n\n| Param         | Type                                              |\n| ------------- | ------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#ttsoptions\"\u003eTTSOptions\u003c/a\u003e\u003c/code\u003e |\n\n--------------------\n\n\n### stop()\n\n```typescript\nstop() =\u003e Promise\u003cvoid\u003e\n```\n\nStops the TTS engine.\n\n--------------------\n\n\n### getSupportedLanguages()\n\n```typescript\ngetSupportedLanguages() =\u003e Promise\u003c{ languages: string[]; }\u003e\n```\n\nReturns a list of supported BCP 47 language tags.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ languages: string[]; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getSupportedVoices()\n\n```typescript\ngetSupportedVoices() =\u003e Promise\u003c{ voices: SpeechSynthesisVoice[]; }\u003e\n```\n\nReturns a list of supported voices.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ voices: SpeechSynthesisVoice[]; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### isLanguageSupported(...)\n\n```typescript\nisLanguageSupported(options: { lang: string; }) =\u003e Promise\u003c{ supported: boolean; }\u003e\n```\n\nChecks if a specific BCP 47 language tag is supported.\n\n| Param         | Type                           |\n| ------------- | ------------------------------ |\n| **`options`** | \u003ccode\u003e{ lang: string; }\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ supported: boolean; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### openInstall()\n\n```typescript\nopenInstall() =\u003e Promise\u003cvoid\u003e\n```\n\nVerifies proper installation and availability of resource files on the system.\n\nOnly available for Android.\n\n--------------------\n\n\n### addListener('onRangeStart', ...)\n\n```typescript\naddListener(eventName: 'onRangeStart', listenerFunc: (info: { start: number; end: number; spokenWord: string; }) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\n| Param              | Type                                                                                |\n| ------------------ | ----------------------------------------------------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'onRangeStart'\u003c/code\u003e                                                         |\n| **`listenerFunc`** | \u003ccode\u003e(info: { start: number; end: number; spokenWord: string; }) =\u0026gt; void\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pluginlistenerhandle\"\u003ePluginListenerHandle\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### Interfaces\n\n\n#### TTSOptions\n\n| Prop                | Type                                                    | Description                                                                                                                                                                    | Default                          | Since |\n| ------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- | ----- |\n| **`text`**          | \u003ccode\u003estring\u003c/code\u003e                                     | The text that will be synthesised when the utterance is spoken.                                                                                                                |                                  |       |\n| **`lang`**          | \u003ccode\u003estring\u003c/code\u003e                                     | The language of the utterance. Possible languages can be queried using `getSupportedLanguages`.                                                                                | \u003ccode\u003e\"en-US\"\u003c/code\u003e             |       |\n| **`rate`**          | \u003ccode\u003enumber\u003c/code\u003e                                     | The speed at which the utterance will be spoken at.                                                                                                                            | \u003ccode\u003e1.0\u003c/code\u003e                 |       |\n| **`pitch`**         | \u003ccode\u003enumber\u003c/code\u003e                                     | The pitch at which the utterance will be spoken at.                                                                                                                            | \u003ccode\u003e1.0\u003c/code\u003e                 |       |\n| **`volume`**        | \u003ccode\u003enumber\u003c/code\u003e                                     | The volume that the utterance will be spoken at.                                                                                                                               | \u003ccode\u003e1.0\u003c/code\u003e                 |       |\n| **`voice`**         | \u003ccode\u003enumber\u003c/code\u003e                                     | The index of the selected voice that will be used to speak the utterance. Possible voices can be queried using `getSupportedVoices`.                                           |                                  |       |\n| **`category`**      | \u003ccode\u003estring\u003c/code\u003e                                     | Select the iOS Audio session category. Possible values: `ambient` and `playback`. Use `playback` to play audio even when the app is in the background. Only available for iOS. | \u003ccode\u003e\"ambient\"\u003c/code\u003e           |       |\n| **`queueStrategy`** | \u003ccode\u003e\u003ca href=\"#queuestrategy\"\u003eQueueStrategy\u003c/a\u003e\u003c/code\u003e | Select the strategy to adopt when several requests to speak overlap.                                                                                                           | \u003ccode\u003eQueueStrategy.Flush\u003c/code\u003e | 5.1.0 |\n\n\n#### SpeechSynthesisVoice\n\nThe \u003ca href=\"#speechsynthesisvoice\"\u003eSpeechSynthesisVoice\u003c/a\u003e interface represents a voice that the system supports.\n\n| Prop               | Type                 | Description                                                                                                 |\n| ------------------ | -------------------- | ----------------------------------------------------------------------------------------------------------- |\n| **`default`**      | \u003ccode\u003eboolean\u003c/code\u003e | Specifies whether the voice is the default voice for the current app (`true`) or not (`false`).             |\n| **`lang`**         | \u003ccode\u003estring\u003c/code\u003e  | BCP 47 language tag indicating the language of the voice.                                                   |\n| **`localService`** | \u003ccode\u003eboolean\u003c/code\u003e | Specifies whether the voice is supplied by a local (`true`) or remote (`false`) speech synthesizer service. |\n| **`name`**         | \u003ccode\u003estring\u003c/code\u003e  | Human-readable name that represents the voice.                                                              |\n| **`voiceURI`**     | \u003ccode\u003estring\u003c/code\u003e  | Type of URI and location of the speech synthesis service for this voice.                                    |\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | \u003ccode\u003e() =\u0026gt; Promise\u0026lt;void\u0026gt;\u003c/code\u003e |\n\n\n### Enums\n\n\n#### QueueStrategy\n\n| Members     | Value          | Description                                                                                                          |\n| ----------- | -------------- | -------------------------------------------------------------------------------------------------------------------- |\n| **`Flush`** | \u003ccode\u003e0\u003c/code\u003e | Use `Flush` to stop the current request when a new request is sent.                                                  |\n| **`Add`**   | \u003ccode\u003e1\u003c/code\u003e | Use `Add` to buffer the speech request. The request will be executed when all previous requests have been completed. |\n\n\u003c/docgen-api\u003e\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/capacitor-community/text-to-speech/blob/master/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/capacitor-community/text-to-speech/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapacitor-community%2Ftext-to-speech","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapacitor-community%2Ftext-to-speech","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapacitor-community%2Ftext-to-speech/lists"}