{"id":42550345,"url":"https://github.com/cap-go/capacitor-speech-recognition","last_synced_at":"2026-06-16T03:04:08.002Z","repository":{"id":323252934,"uuid":"1092625661","full_name":"Cap-go/capacitor-speech-recognition","owner":"Cap-go","description":"Capacitor plugin for speech recognition.","archived":false,"fork":false,"pushed_at":"2026-02-04T02:22:19.000Z","size":463,"stargazers_count":8,"open_issues_count":3,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-04T14:26:30.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cap-go.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"Cap-go","patreon":null,"open_collective":"capgo","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2025-11-09T01:19:57.000Z","updated_at":"2026-02-04T02:22:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Cap-go/capacitor-speech-recognition","commit_stats":null,"previous_names":["cap-go/capacitor-speech-recognition"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Cap-go/capacitor-speech-recognition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-speech-recognition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-speech-recognition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-speech-recognition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-speech-recognition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cap-go","download_url":"https://codeload.github.com/Cap-go/capacitor-speech-recognition/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-speech-recognition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29642905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T05:21:04.652Z","status":"ssl_error","status_checked_at":"2026-02-20T05:21:04.238Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-28T19:07:46.698Z","updated_at":"2026-06-16T03:04:07.994Z","avatar_url":"https://github.com/Cap-go.png","language":"Java","funding_links":["https://github.com/sponsors/Cap-go","https://opencollective.com/capgo"],"categories":[],"sub_categories":[],"readme":"# @capgo/capacitor-speech-recognition\n\u003ca href=\"https://capgo.app/\"\u003e\u003cimg src=\"https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-speech-recognition\" alt=\"Capgo - Instant updates for Capacitor\" /\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/?ref=plugin_speech_recognition\"\u003e ➡️ Get Instant updates for your App with Capgo\u003c/a\u003e\u003c/h2\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/consulting/?ref=plugin_speech_recognition\"\u003e Missing a feature? We’ll build the plugin for you 💪\u003c/a\u003e\u003c/h2\u003e\n\u003c/div\u003e\n\nNatural, low-latency speech recognition for Capacitor apps with parity across iOS and Android, streaming partial results, and permission helpers baked in.\n\n## Why this plugin?\n\nThis package starts from the excellent [`capacitor-community/speech-recognition`](https://github.com/capacitor-community/speech-recognition) plugin, but folds in the most requested pull requests from that repo (punctuation support, segmented sessions, crash fixes) and keeps them maintained under the Capgo umbrella. You get the familiar API plus:\n\n- ✅ **Merged community PRs** – punctuation toggles on iOS (PR #74), segmented results \u0026 silence handling on Android (PR #104), and the `recognitionRequest` safety fix (PR #105) ship out-of-the-box.\n- 🚀 **New Capgo features** – configurable silence windows, streaming segment listeners, consistent permission helpers, and a refreshed example app.\n- 🛠️ **Active maintenance** – same conventions as all Capgo plugins (SPM, Podspec, workflows, example app) so it tracks Capacitor major versions without bit-rot.\n- 📦 **Drop-in migration** – TypeScript definitions remain compatible with the community plugin while exposing the extra options (`addPunctuation`, `allowForSilence`, `segmentResults`, etc.).\n\n## Documentation\n\nThe most complete doc is available here: https://capgo.app/docs/plugins/speech-recognition/\n\n## Compatibility\n\n| Plugin version | Capacitor compatibility | Maintained |\n| -------------- | ----------------------- | ---------- |\n| v8.\\*.\\*       | v8.\\*.\\*                | ✅          |\n| v7.\\*.\\*       | v7.\\*.\\*                | On demand   |\n| v6.\\*.\\*       | v6.\\*.\\*                | ❌          |\n| v5.\\*.\\*       | v5.\\*.\\*                | ❌          |\n\n\u003e **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.\n\n## Install\n\n```bash\nbun add @capgo/capacitor-speech-recognition\nbunx cap sync\n```\n\n## Usage\n\n```ts\nimport { SpeechRecognition } from '@capgo/capacitor-speech-recognition';\n\nawait SpeechRecognition.requestPermissions();\n\nconst { available } = await SpeechRecognition.available();\nif (!available) {\n  console.warn('Speech recognition is not supported on this device.');\n}\n\nconst partialListener = await SpeechRecognition.addListener('partialResults', (event) =\u003e {\n  console.log('Partial:', event.matches?.[0]);\n});\n\nawait SpeechRecognition.start({\n  language: 'en-US',\n  maxResults: 3,\n  partialResults: true,\n});\n\n// Later, when you want to stop listening\nawait SpeechRecognition.stop();\nawait partialListener.remove();\n```\n\n### iOS fallback and contextual strings\n\niOS uses `SFSpeechRecognizer` by default, including on versions below iOS 26.\nSet `useOnDeviceRecognition: true` only when you want the iOS 26+\n`SpeechAnalyzer` path and `isOnDeviceRecognitionAvailable()` reports support.\nIf that newer path is unavailable, the plugin falls back to `SFSpeechRecognizer`.\n\nUse `contextualStrings` to bias recognition toward app-specific terms on the\n`SFSpeechRecognizer` path:\n\n```ts\nawait SpeechRecognition.start({\n  language: 'en-US',\n  partialResults: true,\n  contextualStrings: ['Capgo', 'Live Update', 'channel override'],\n});\n```\n\n## On-device recognition mode\n\nThis plugin now supports an opt-in on-device recognition path behind the explicit\n`useOnDeviceRecognition` flag.\n\n### What it is\n\nThe default path keeps the long-standing recognizer flow for backward compatibility.\n`useOnDeviceRecognition` switches to a newer local speech pipeline when the platform supports it:\n\n- On iOS 26+, it uses Apple's `SpeechAnalyzer` / `SpeechTranscriber` stack.\n- On older iOS versions, unsupported iOS 26+ locales, or when the flag is disabled, it uses `SFSpeechRecognizer`.\n- On recent Android versions, it uses the on-device `SpeechRecognizer` path.\n\n### Why you might want it\n\n- Better alignment with the latest native speech APIs.\n- Improved on-device model handling on supported platforms.\n- A cleaner rollout path if you want to adopt newer speech stacks without changing every user immediately.\n\n### Why it is opt-in\n\nEven when a new stack is technically available, changing recognition behavior silently can affect:\n\n- transcript wording\n- punctuation behavior\n- partial-result timing\n- product metrics and user expectations\n\nThat is why the plugin keeps the legacy recognizer by default and requires an explicit flag for the new path.\n\n### Recommended rollout\n\n1. Check generic speech support with `available()`.\n2. Check the on-device path with `isOnDeviceRecognitionAvailable()`.\n3. Enable `useOnDeviceRecognition` only when that second check returns `true`.\n4. Roll it out gradually if your app depends on stable transcripts or analytics.\n\n### Example\n\n```ts\nimport { SpeechRecognition } from '@capgo/capacitor-speech-recognition';\n\nawait SpeechRecognition.requestPermissions();\n\nconst { available } = await SpeechRecognition.available();\nif (!available) {\n  throw new Error('Speech recognition is not available on this device.');\n}\n\nconst { available: onDeviceRecognitionAvailable } =\n  await SpeechRecognition.isOnDeviceRecognitionAvailable({\n    language: 'en-US',\n  });\n\nawait SpeechRecognition.start({\n  language: 'en-US',\n  partialResults: true,\n  useOnDeviceRecognition: onDeviceRecognitionAvailable,\n});\n```\n\n### When not to use it yet\n\nStay on the default path if:\n\n- you need unchanged behavior for existing users\n- you have not validated transcripts for your target locale\n- you want identical production behavior across older and newer OS versions\n\n### Platform notes\n\n- iOS uses the newer on-device path only on iOS 26+ and only for locales Apple exposes through the newer speech stack.\n- Android uses the on-device recognizer only in inline mode. `popup: true` keeps using the system dialog and is not compatible with `useOnDeviceRecognition`.\n- On Android, a supported on-device language may require a model download before recognition can begin.\n\n## Push-to-talk and session events\n\nThis plugin also supports a push-to-talk oriented flow built around three APIs:\n\n- `setPTTState({ held })` lets your UI tell the plugin when the button is pressed or released.\n- `forceStop()` stops the active session immediately and emits the last cached partial result with `forced: true` when available.\n- `getLastPartialResult()` lets you read back the latest cached transcript at any point.\n\n`continuousPTT` is the experimental cross-platform mode that keeps a held push-to-talk session alive by restarting recognition as speech segments finalize. Android and iOS both support this restart flow for inline/native recognition.\n\nThe plugin also emits deterministic session lifecycle events so UIs can react cleanly:\n\n- `listeningState` now carries `state`, `sessionId`, `reason`, and optional `errorCode` in addition to the legacy `status`.\n- `error` is emitted for every native recognizer error instead of relying only on promise rejections.\n- `readyForNextSession` signals when native resources are torn down and the plugin is ready for another start.\n\n### iOS usage descriptions\n\nAdd the following keys to your app `Info.plist`:\n\n- `NSSpeechRecognitionUsageDescription`\n- `NSMicrophoneUsageDescription`\n\n## API\n\n\u003cdocgen-index\u003e\n\n* [`available()`](#available)\n* [`isOnDeviceRecognitionAvailable(...)`](#isondevicerecognitionavailable)\n* [`start(...)`](#start)\n* [`stop()`](#stop)\n* [`forceStop(...)`](#forcestop)\n* [`getLastPartialResult()`](#getlastpartialresult)\n* [`setPTTState(...)`](#setpttstate)\n* [`getSupportedLanguages()`](#getsupportedlanguages)\n* [`isListening()`](#islistening)\n* [`checkPermissions()`](#checkpermissions)\n* [`requestPermissions()`](#requestpermissions)\n* [`getPluginVersion()`](#getpluginversion)\n* [`addListener('endOfSegmentedSession', ...)`](#addlistenerendofsegmentedsession-)\n* [`addListener('segmentResults', ...)`](#addlistenersegmentresults-)\n* [`addListener('partialResults', ...)`](#addlistenerpartialresults-)\n* [`addListener('listeningState', ...)`](#addlistenerlisteningstate-)\n* [`addListener('error', ...)`](#addlistenererror-)\n* [`addListener('readyForNextSession', ...)`](#addlistenerreadyfornextsession-)\n* [`removeAllListeners()`](#removealllisteners)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\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### available()\n\n```typescript\navailable() =\u003e Promise\u003cSpeechRecognitionAvailability\u003e\n```\n\nChecks whether the native speech recognition service is usable on the current device.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#speechrecognitionavailability\"\u003eSpeechRecognitionAvailability\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### isOnDeviceRecognitionAvailable(...)\n\n```typescript\nisOnDeviceRecognitionAvailable(options?: Pick\u003cSpeechRecognitionStartOptions, \"language\"\u003e | undefined) =\u003e Promise\u003cSpeechRecognitionAvailability\u003e\n```\n\nChecks whether the platform's newer on-device recognition path is available for the selected locale.\n\nThis is the capability check you should use before enabling `useOnDeviceRecognition`.\nA `true` result means the current device, OS version, and locale can use the newer\non-device path for that platform.\n\nReturns `false` when the device only supports the legacy recognizer path.\n\nPlatform SDK docs:\niOS: [Speech](https://developer.apple.com/documentation/speech)\nAndroid: [SpeechRecognizer](https://developer.android.com/reference/android/speech/SpeechRecognizer)\n\n| Param         | Type                                                                                                                                |\n| ------------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#pick\"\u003ePick\u003c/a\u003e\u0026lt;\u003ca href=\"#speechrecognitionstartoptions\"\u003eSpeechRecognitionStartOptions\u003c/a\u003e, 'language'\u0026gt;\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#speechrecognitionavailability\"\u003eSpeechRecognitionAvailability\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### start(...)\n\n```typescript\nstart(options?: SpeechRecognitionStartOptions | undefined) =\u003e Promise\u003cSpeechRecognitionMatches\u003e\n```\n\nBegins capturing audio and transcribing speech.\n\nWhen `partialResults` is `true`, the returned promise resolves immediately and updates are\nstreamed through the `partialResults` listener until the session ends.\n\nThe default path keeps the legacy recognizer behavior for backward compatibility.\nPass `useOnDeviceRecognition: true` only after checking\n{@link SpeechRecognitionPlugin.isOnDeviceRecognitionAvailable}.\n\n| Param         | Type                                                                                    |\n| ------------- | --------------------------------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#speechrecognitionstartoptions\"\u003eSpeechRecognitionStartOptions\u003c/a\u003e\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#speechrecognitionmatches\"\u003eSpeechRecognitionMatches\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### stop()\n\n```typescript\nstop() =\u003e Promise\u003cvoid\u003e\n```\n\nStops listening and tears down native resources.\n\n--------------------\n\n\n### forceStop(...)\n\n```typescript\nforceStop(options?: ForceStopOptions | undefined) =\u003e Promise\u003cvoid\u003e\n```\n\nForce stops the current session.\n\nOn Android, this first tries a normal stop and then falls back to destroy/recreate after `timeout`.\nOn iOS, the current session is stopped immediately.\n\nIf a partial transcript is cached, it is emitted through the `partialResults` listener with `forced: true`.\n\n| Param         | Type                                                          |\n| ------------- | ------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#forcestopoptions\"\u003eForceStopOptions\u003c/a\u003e\u003c/code\u003e |\n\n--------------------\n\n\n### getLastPartialResult()\n\n```typescript\ngetLastPartialResult() =\u003e Promise\u003cLastPartialResult\u003e\n```\n\nGets the last cached partial transcription result.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#lastpartialresult\"\u003eLastPartialResult\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### setPTTState(...)\n\n```typescript\nsetPTTState(options: PTTStateOptions) =\u003e Promise\u003cvoid\u003e\n```\n\nUpdates the current push-to-talk button state.\n\nUse this together with `continuousPTT` or with a custom hold-to-talk flow.\n\n| Param         | Type                                                        |\n| ------------- | ----------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#pttstateoptions\"\u003ePTTStateOptions\u003c/a\u003e\u003c/code\u003e |\n\n--------------------\n\n\n### getSupportedLanguages()\n\n```typescript\ngetSupportedLanguages() =\u003e Promise\u003cSpeechRecognitionLanguages\u003e\n```\n\nGets the locales supported by the underlying recognizer.\n\nAndroid 13+ devices no longer expose this list; in that case `languages` is empty.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#speechrecognitionlanguages\"\u003eSpeechRecognitionLanguages\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### isListening()\n\n```typescript\nisListening() =\u003e Promise\u003cSpeechRecognitionListening\u003e\n```\n\nReturns whether the plugin is actively listening for speech.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#speechrecognitionlistening\"\u003eSpeechRecognitionListening\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### checkPermissions()\n\n```typescript\ncheckPermissions() =\u003e Promise\u003cSpeechRecognitionPermissionStatus\u003e\n```\n\nGets the current permission state.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#speechrecognitionpermissionstatus\"\u003eSpeechRecognitionPermissionStatus\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### requestPermissions()\n\n```typescript\nrequestPermissions() =\u003e Promise\u003cSpeechRecognitionPermissionStatus\u003e\n```\n\nRequests the microphone + speech recognition permissions.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#speechrecognitionpermissionstatus\"\u003eSpeechRecognitionPermissionStatus\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getPluginVersion()\n\n```typescript\ngetPluginVersion() =\u003e Promise\u003c{ version: string; }\u003e\n```\n\nReturns the native plugin version bundled with this package.\n\nUseful when reporting issues to confirm that native and JS versions match.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ version: string; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('endOfSegmentedSession', ...)\n\n```typescript\naddListener(eventName: 'endOfSegmentedSession', listenerFunc: () =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\nListen for segmented session completion events (Android only).\n\n| Param              | Type                                 |\n| ------------------ | ------------------------------------ |\n| **`eventName`**    | \u003ccode\u003e'endOfSegmentedSession'\u003c/code\u003e |\n| **`listenerFunc`** | \u003ccode\u003e() =\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### addListener('segmentResults', ...)\n\n```typescript\naddListener(eventName: 'segmentResults', listenerFunc: (event: SpeechRecognitionSegmentResultEvent) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\nListen for segmented recognition results (Android only).\n\n| Param              | Type                                                                                                                    |\n| ------------------ | ----------------------------------------------------------------------------------------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'segmentResults'\u003c/code\u003e                                                                                           |\n| **`listenerFunc`** | \u003ccode\u003e(event: \u003ca href=\"#speechrecognitionsegmentresultevent\"\u003eSpeechRecognitionSegmentResultEvent\u003c/a\u003e) =\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### addListener('partialResults', ...)\n\n```typescript\naddListener(eventName: 'partialResults', listenerFunc: (event: SpeechRecognitionPartialResultEvent) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\nListen for partial transcription updates emitted while `partialResults` is enabled.\n\n| Param              | Type                                                                                                                    |\n| ------------------ | ----------------------------------------------------------------------------------------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'partialResults'\u003c/code\u003e                                                                                           |\n| **`listenerFunc`** | \u003ccode\u003e(event: \u003ca href=\"#speechrecognitionpartialresultevent\"\u003eSpeechRecognitionPartialResultEvent\u003c/a\u003e) =\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### addListener('listeningState', ...)\n\n```typescript\naddListener(eventName: 'listeningState', listenerFunc: (event: SpeechRecognitionListeningEvent) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\nListen for changes to the native listening state.\n\n| Param              | Type                                                                                                            |\n| ------------------ | --------------------------------------------------------------------------------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'listeningState'\u003c/code\u003e                                                                                   |\n| **`listenerFunc`** | \u003ccode\u003e(event: \u003ca href=\"#speechrecognitionlisteningevent\"\u003eSpeechRecognitionListeningEvent\u003c/a\u003e) =\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### addListener('error', ...)\n\n```typescript\naddListener(eventName: 'error', listenerFunc: (event: SpeechRecognitionErrorEvent) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\nListen for recognition errors.\n\n| Param              | Type                                                                                                    |\n| ------------------ | ------------------------------------------------------------------------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'error'\u003c/code\u003e                                                                                    |\n| **`listenerFunc`** | \u003ccode\u003e(event: \u003ca href=\"#speechrecognitionerrorevent\"\u003eSpeechRecognitionErrorEvent\u003c/a\u003e) =\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### addListener('readyForNextSession', ...)\n\n```typescript\naddListener(eventName: 'readyForNextSession', listenerFunc: (event: SpeechRecognitionReadyEvent) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\nListen for the recognizer becoming ready for another session.\n\n| Param              | Type                                                                                                    |\n| ------------------ | ------------------------------------------------------------------------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'readyForNextSession'\u003c/code\u003e                                                                      |\n| **`listenerFunc`** | \u003ccode\u003e(event: \u003ca href=\"#speechrecognitionreadyevent\"\u003eSpeechRecognitionReadyEvent\u003c/a\u003e) =\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### removeAllListeners()\n\n```typescript\nremoveAllListeners() =\u003e Promise\u003cvoid\u003e\n```\n\nRemoves every registered listener.\n\n--------------------\n\n\n### Interfaces\n\n\n#### SpeechRecognitionAvailability\n\n| Prop            | Type                 |\n| --------------- | -------------------- |\n| **`available`** | \u003ccode\u003eboolean\u003c/code\u003e |\n\n\n#### SpeechRecognitionStartOptions\n\nConfigure how the recognizer behaves when calling {@link SpeechRecognitionPlugin.start}.\n\n| Prop                         | Type                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n| ---------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| **`language`**               | \u003ccode\u003estring\u003c/code\u003e   | Locale identifier such as `en-US`. When omitted the device language is used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| **`maxResults`**             | \u003ccode\u003enumber\u003c/code\u003e   | Maximum number of final matches returned by native APIs. Defaults to `5`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| **`prompt`**                 | \u003ccode\u003estring\u003c/code\u003e   | Prompt message shown inside the Android system dialog (ignored on iOS).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| **`popup`**                  | \u003ccode\u003eboolean\u003c/code\u003e  | When `true`, Android shows the OS speech dialog instead of running inline recognition. Defaults to `false`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n| **`partialResults`**         | \u003ccode\u003eboolean\u003c/code\u003e  | Emits partial transcription updates through the `partialResults` listener while audio is captured.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |\n| **`addPunctuation`**         | \u003ccode\u003eboolean\u003c/code\u003e  | Enables native punctuation handling where supported (iOS 16+).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| **`contextualStrings`**      | \u003ccode\u003estring[]\u003c/code\u003e | Words or phrases that should be recognized more accurately by native speech APIs. On iOS, these are passed to `SFSpeechRecognitionRequest.contextualStrings` when the plugin uses the legacy `SFSpeechRecognizer` path. That path is the default on all iOS versions, the fallback below iOS 26, and still available on iOS 26+ by leaving `useOnDeviceRecognition` disabled. Ignored by Android and by the iOS 26+ `SpeechAnalyzer` path.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| **`useOnDeviceRecognition`** | \u003ccode\u003eboolean\u003c/code\u003e  | Opt in to the platform's newer on-device recognition path when available. On iOS 26+, this uses Apple's `SpeechAnalyzer` / `SpeechTranscriber` pipeline. On recent Android versions, this uses the on-device `SpeechRecognizer` path. It is intentionally opt-in so existing apps keep the legacy flow unless they choose to roll out the new behavior. On iOS, leaving this disabled keeps `SFSpeechRecognizer` on every supported OS version. Enabling it on older iOS versions or unsupported locales falls back to `SFSpeechRecognizer`. Use {@link SpeechRecognitionPlugin.isOnDeviceRecognitionAvailable} before enabling it in production. Platform SDK docs: iOS: [Speech](https://developer.apple.com/documentation/speech), [SpeechAnalyzer](https://developer.apple.com/documentation/speech/speechanalyzer), [SpeechTranscriber](https://developer.apple.com/documentation/speech/speechtranscriber) Android: [SpeechRecognizer](https://developer.android.com/reference/android/speech/SpeechRecognizer) Defaults to `false`. |\n| **`allowForSilence`**        | \u003ccode\u003enumber\u003c/code\u003e   | Allow a number of milliseconds of silence before splitting the recognition session into segments. Required to be greater than zero and currently supported on Android only.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n| **`continuousPTT`**          | \u003ccode\u003eboolean\u003c/code\u003e  | EXPERIMENTAL: Keep a PTT session alive across silence by restarting recognition while the button stays held. This restart behavior is implemented for Android inline recognition and iOS native recognition.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n\n\n#### SpeechRecognitionMatches\n\n| Prop          | Type                  |\n| ------------- | --------------------- |\n| **`matches`** | \u003ccode\u003estring[]\u003c/code\u003e |\n\n\n#### ForceStopOptions\n\nOptions for {@link SpeechRecognitionPlugin.forceStop}.\n\n| Prop          | Type                | Description                                                                                                                                                                       |\n| ------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **`timeout`** | \u003ccode\u003enumber\u003c/code\u003e | Android only: timeout in milliseconds before forcing stop via destroy/recreate. On iOS, the current session is stopped immediately and this value is ignored. Defaults to `1500`. |\n\n\n#### LastPartialResult\n\nResult from {@link SpeechRecognitionPlugin.getLastPartialResult}.\n\n| Prop            | Type                  | Description                                                     |\n| --------------- | --------------------- | --------------------------------------------------------------- |\n| **`available`** | \u003ccode\u003eboolean\u003c/code\u003e  | Whether a partial result is currently cached.                   |\n| **`text`**      | \u003ccode\u003estring\u003c/code\u003e   | The most recent transcript text known to the native recognizer. |\n| **`matches`**   | \u003ccode\u003estring[]\u003c/code\u003e | All current match alternatives when available.                  |\n\n\n#### PTTStateOptions\n\nOptions for {@link SpeechRecognitionPlugin.setPTTState}.\n\n| Prop       | Type                 | Description                               |\n| ---------- | -------------------- | ----------------------------------------- |\n| **`held`** | \u003ccode\u003eboolean\u003c/code\u003e | Whether the PTT button is currently held. |\n\n\n#### SpeechRecognitionLanguages\n\n| Prop            | Type                  |\n| --------------- | --------------------- |\n| **`languages`** | \u003ccode\u003estring[]\u003c/code\u003e |\n\n\n#### SpeechRecognitionListening\n\n| Prop            | Type                 |\n| --------------- | -------------------- |\n| **`listening`** | \u003ccode\u003eboolean\u003c/code\u003e |\n\n\n#### SpeechRecognitionPermissionStatus\n\nPermission map returned by `checkPermissions` and `requestPermissions`.\n\nOn Android the state maps to the `RECORD_AUDIO` permission.\nOn iOS it combines speech recognition plus microphone permission.\n\n| Prop                    | Type                                                        |\n| ----------------------- | ----------------------------------------------------------- |\n| **`speechRecognition`** | \u003ccode\u003e\u003ca href=\"#permissionstate\"\u003ePermissionState\u003c/a\u003e\u003c/code\u003e |\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | \u003ccode\u003e() =\u0026gt; Promise\u0026lt;void\u0026gt;\u003c/code\u003e |\n\n\n#### SpeechRecognitionSegmentResultEvent\n\nRaised whenever a segmented result is produced (Android only).\n\n| Prop          | Type                  |\n| ------------- | --------------------- |\n| **`matches`** | \u003ccode\u003estring[]\u003c/code\u003e |\n\n\n#### SpeechRecognitionPartialResultEvent\n\nRaised whenever a partial transcription is produced.\n\n| Prop                  | Type                  | Description                                                                                                                       |\n| --------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| **`matches`**         | \u003ccode\u003estring[]\u003c/code\u003e | Current recognition matches when the native recognizer reports them. This can be omitted for forced or accumulated-only payloads. |\n| **`accumulated`**     | \u003ccode\u003estring\u003c/code\u003e   | Accumulated transcription from earlier continuous PTT cycles.                                                                     |\n| **`accumulatedText`** | \u003ccode\u003estring\u003c/code\u003e   | Final accumulated text including the current result.                                                                              |\n| **`isRestarting`**    | \u003ccode\u003eboolean\u003c/code\u003e  | `true` when the plugin is restarting recognition inside a continuous PTT session.                                                 |\n| **`forced`**          | \u003ccode\u003eboolean\u003c/code\u003e  | `true` when the payload was emitted by `forceStop()`.                                                                             |\n\n\n#### SpeechRecognitionListeningEvent\n\nRaised when the listening state changes.\n\nThe original `status` field is preserved for backward compatibility and is present\non the binary `started` / `stopped` states.\n\n| Prop            | Type                                                                  | Description                                                |\n| --------------- | --------------------------------------------------------------------- | ---------------------------------------------------------- |\n| **`state`**     | \u003ccode\u003e\u003ca href=\"#listeningfinitestate\"\u003eListeningFiniteState\u003c/a\u003e\u003c/code\u003e | Finite state of the recognition session.                   |\n| **`sessionId`** | \u003ccode\u003enumber\u003c/code\u003e                                                   | Unique identifier for the current listening session.       |\n| **`reason`**    | \u003ccode\u003e\u003ca href=\"#listeningreason\"\u003eListeningReason\u003c/a\u003e\u003c/code\u003e           | Why this state transition occurred.                        |\n| **`errorCode`** | \u003ccode\u003estring\u003c/code\u003e                                                   | Error code when the transition is caused by an error.      |\n| **`status`**    | \u003ccode\u003e'started' \\| 'stopped'\u003c/code\u003e                                   | Backward-compatible binary state used by earlier releases. |\n\n\n#### SpeechRecognitionErrorEvent\n\nRaised whenever native recognition reports an error.\n\n| Prop            | Type                |\n| --------------- | ------------------- |\n| **`code`**      | \u003ccode\u003estring\u003c/code\u003e |\n| **`message`**   | \u003ccode\u003estring\u003c/code\u003e |\n| **`sessionId`** | \u003ccode\u003enumber\u003c/code\u003e |\n\n\n#### SpeechRecognitionReadyEvent\n\nEmitted after native resources have been torn down and the plugin is ready for another session.\n\n| Prop            | Type                |\n| --------------- | ------------------- |\n| **`sessionId`** | \u003ccode\u003enumber\u003c/code\u003e |\n\n\n### Type Aliases\n\n\n#### Pick\n\nFrom T, pick a set of properties whose keys are in the union K\n\n\u003ccode\u003e{\r [P in K]: T[P];\r }\u003c/code\u003e\n\n\n#### PermissionState\n\n\u003ccode\u003e'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'\u003c/code\u003e\n\n\n#### ListeningFiniteState\n\nFinite state values for the recognition session lifecycle.\n\n\u003ccode\u003e'startingListening' | 'started' | 'stoppingListening' | 'stopped'\u003c/code\u003e\n\n\n#### ListeningReason\n\nWhy a listening state transition happened.\n\n\u003ccode\u003e'userStart' | 'userStop' | 'forceStop' | 'results' | 'silence' | 'error' | 'unknown'\u003c/code\u003e\n\n\u003c/docgen-api\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap-go%2Fcapacitor-speech-recognition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcap-go%2Fcapacitor-speech-recognition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap-go%2Fcapacitor-speech-recognition/lists"}