{"_id":"@capacitor-mlkit/genai-speech-recognition","_rev":"3-c080aec875acc80fc92c370f1de35562","name":"@capacitor-mlkit/genai-speech-recognition","dist-tags":{"latest":"8.2.1"},"versions":{"8.1.0":{"name":"@capacitor-mlkit/genai-speech-recognition","version":"8.1.0","keywords":["capacitor","plugin","native","capacitor-plugin","mlkit","ml kit","genai","gemini nano","speech recognition","speech-to-text","transcription","on-device ai"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"Apache-2.0","_id":"@capacitor-mlkit/genai-speech-recognition@8.1.0","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/mlkit/genai-speech-recognition/","bugs":{"url":"https://github.com/capawesome-team/capacitor-mlkit/issues"},"dist":{"shasum":"4667a41b9a3c3d103f5f4f1e1f2061a98757de7f","tarball":"https://registry.npmjs.org/@capacitor-mlkit/genai-speech-recognition/-/genai-speech-recognition-8.1.0.tgz","fileCount":38,"integrity":"sha512-40SnJ77zgfBplD9LHQLwGbCobiu+8fs0LiHWSML0JrWWyFl/cmyOLdfPsSemxWNa42ABwIj20ZFD57KOQrH0fg==","signatures":[{"sig":"MEQCICtH3PP54ZEEgUDlPODqB2V/gxkcBtayutvlsBR5TgIZAiASmIbfgJZFBIu9sD+Qrw7HDmEsmg3uZy9VX4T0D/dTNQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":117687},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"6557f01f9f882afd5a13dff597f7635009585822","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api GenAiSpeechRecognitionPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"robingenz","email":"mail@robingenz.dev"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/capawesome-team/capacitor-mlkit.git","type":"git"},"_npmVersion":"11.13.0","description":"Capacitor plugin for ML Kit GenAI Speech Recognition on Android.","directories":{},"_nodeVersion":"24.16.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.53.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.0.0","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/genai-speech-recognition_8.1.0_1783756942210_0.1712844685156074","host":"s3://npm-registry-packages-npm-production"}},"8.2.0":{"name":"@capacitor-mlkit/genai-speech-recognition","version":"8.2.0","keywords":["capacitor","plugin","native","capacitor-plugin","mlkit","ml kit","genai","gemini nano","speech recognition","speech-to-text","transcription","on-device ai"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"Apache-2.0","_id":"@capacitor-mlkit/genai-speech-recognition@8.2.0","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/mlkit/genai-speech-recognition/","bugs":{"url":"https://github.com/capawesome-team/capacitor-mlkit/issues"},"dist":{"shasum":"30d1ab068cba0b3bae0e2a77a20e67037b20ab37","tarball":"https://registry.npmjs.org/@capacitor-mlkit/genai-speech-recognition/-/genai-speech-recognition-8.2.0.tgz","fileCount":38,"integrity":"sha512-n/NMQBZj+F6GLqkKlt+CcC/L5DEAqAbkfLGyJRMQuXpUk5WgbCMy1O8sKYua0u4f5V+pPjJGCn4PiVrsVa5rhA==","signatures":[{"sig":"MEQCIDyeFnIm3MLBJCtbD4ZlHzLpEiM8kq/AAzANBeU4AaoRAiA1eoFCxwK8yzc66rDDX/ao0e54S2F+w4RN0LnK1Qiguw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capacitor-mlkit%2fgenai-speech-recognition@8.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":117696},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"b960e3339eb497476360d5a6b24bb993f3449ba8","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api GenAiSpeechRecognitionPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd .."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f1a20f22-8868-4202-9bde-2be693537789"}},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/capawesome-team/capacitor-mlkit.git","type":"git"},"_npmVersion":"11.16.0","description":"Capacitor plugin for ML Kit GenAI Speech Recognition on Android.","directories":{},"_nodeVersion":"24.18.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.53.3","swiftlint":"2.0.0","typescript":"5.9.3","@capacitor/cli":"8.0.0","@capacitor/ios":"8.0.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.6.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/genai-speech-recognition_8.2.0_1784269871182_0.6019659436525153","host":"s3://npm-registry-packages-npm-production"}},"8.2.1":{"name":"@capacitor-mlkit/genai-speech-recognition","version":"8.2.1","description":"Capacitor plugin for ML Kit GenAI Speech Recognition on Android.","main":"dist/plugin.cjs.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/capawesome-team/capacitor-mlkit.git"},"bugs":{"url":"https://github.com/capawesome-team/capacitor-mlkit/issues"},"funding":[{"type":"github","url":"https://github.com/sponsors/capawesome-team/"},{"type":"opencollective","url":"https://opencollective.com/capawesome"}],"keywords":["capacitor","plugin","native","capacitor-plugin","mlkit","ml kit","genai","gemini nano","speech recognition","speech-to-text","transcription","on-device ai"],"scripts":{"verify":"npm run verify:ios && npm run verify:android && npm run verify:web","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:android":"cd android && ./gradlew clean build test && cd ..","verify:web":"npm run build","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","eslint":"eslint . --ext ts","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","docgen":"docgen --api GenAiSpeechRecognitionPlugin --output-readme README.md --output-json dist/docs.json","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","ios:pod:install":"cd ios && pod install --repo-update && cd ..","ios:spm:install":"cd ios && swift package resolve && cd ..","prepublishOnly":"npm run build"},"devDependencies":{"@capacitor/android":"8.0.0","@capacitor/cli":"8.5.0","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/ios":"8.0.0","@ionic/eslint-config":"0.4.0","eslint":"8.57.0","prettier-plugin-java":"2.9.7","rimraf":"6.1.2","rollup":"4.62.3","swiftlint":"2.0.0","typescript":"5.9.3"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"swiftlint":"@ionic/swiftlint-config","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"publishConfig":{"access":"public"},"homepage":"https://capawesome.io/docs/sdks/capacitor/mlkit/genai-speech-recognition/","gitHead":"0fcd1977cfb70d9c39d618680045cf01434aebf2","_id":"@capacitor-mlkit/genai-speech-recognition@8.2.1","_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-dpwXE8XvHm6vZGq0THsf//UtoDe+0uN9ljwGHEy54Viebwdz3PIZakCDxGvXG6gYjMdYvtlpnJ3Nb35bm8tZTQ==","shasum":"394e0c878d1206820ff3a981db2376ba311fc983","tarball":"https://registry.npmjs.org/@capacitor-mlkit/genai-speech-recognition/-/genai-speech-recognition-8.2.1.tgz","fileCount":38,"unpackedSize":117696,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capacitor-mlkit%2fgenai-speech-recognition@8.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEox1IifesenWOLlA64c2hPl1C9EsJ0oVA4ahw49I/0OAiEA9hXhiRXLE7iilyHsfhhFi49QXQp/0zeHlne9f1/6DPY="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f1a20f22-8868-4202-9bde-2be693537789"}},"directories":{},"maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/genai-speech-recognition_8.2.1_1789015848283_0.4016738038432597"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-11T08:02:22.034Z","modified":"2026-09-10T04:50:48.713Z","8.1.0":"2026-07-11T08:02:22.349Z","8.2.0":"2026-07-17T06:31:11.317Z","8.2.1":"2026-09-10T04:50:48.414Z"},"bugs":{"url":"https://github.com/capawesome-team/capacitor-mlkit/issues"},"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"Apache-2.0","homepage":"https://capawesome.io/docs/sdks/capacitor/mlkit/genai-speech-recognition/","keywords":["capacitor","plugin","native","capacitor-plugin","mlkit","ml kit","genai","gemini nano","speech recognition","speech-to-text","transcription","on-device ai"],"repository":{"type":"git","url":"git+https://github.com/capawesome-team/capacitor-mlkit.git"},"description":"Capacitor plugin for ML Kit GenAI Speech Recognition on Android.","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"readme":"# Capacitor ML Kit GenAI Speech Recognition Plugin\n\nUnofficial Capacitor plugin for [ML Kit GenAI Speech Recognition](https://developers.google.com/ml-kit/genai/speech-recognition).[^1]\n\n> [!WARNING]\n> The ML Kit GenAI Speech Recognition API is currently in **alpha**. The API surface and behavior may change in future releases and breaking changes are expected. Additionally, the advanced recognition mode is currently only available on a very limited set of devices (e.g. Pixel 10).\n\n<div class=\"capawesome-z29o10a\">\n  <a href=\"https://cloud.capawesome.io/\" target=\"_blank\">\n    <img alt=\"Deliver Live Updates to your Capacitor app with Capawesome Cloud\" src=\"https://cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1\" />\n  </a>\n</div>\n\n## Use Cases\n\nThe GenAI Speech Recognition plugin is typically used to transcribe spoken words into text in real time, for example:\n\n- **Voice input**: Let users dictate messages, notes or search queries instead of typing.\n- **Live transcription**: Transcribe meetings, lectures or interviews on-device.\n- **Voice commands**: Build hands-free experiences that react to spoken input.\n\n## Requirements\n\nThis plugin performs speech recognition entirely on-device. It is only available on Android and supports two recognition modes with different requirements:\n\n- **Basic mode**: Speech recognition using a traditional speech model. Requires Android API level 31 or higher. Supported locales: `en-US`, `fr-FR` (beta), `it-IT` (beta), `de-DE` (beta), `es-ES` (beta), `hi-IN` (beta), `ja-JP` (beta), `pt-BR` (beta), `tr-TR` (beta), `pl-PL` (beta), `cmn-Hans-CN` (beta), `ko-KR` (beta), `cmn-Hant-TW` (beta), `ru-RU` (beta), `vi-VN` (beta).\n- **Advanced mode**: Speech recognition using a GenAI model. Currently only available on a very limited set of devices (e.g. Pixel 10). Supported locales: `en-US`, `ko-KR`, `es-ES`, `fr-FR`, `de-DE`, `it-IT`, `pt-PT`, `cmn-Hans-CN`, `cmn-Hant-TW`, `ja-JP`, `th-TH`, `ru-RU`, `nl-NL` (beta), `da-DK` (beta), `sv-SE` (beta), `pl-PL` (beta), `hi-IN` (beta), `vi-VN` (beta), `id-ID` (beta), `ar-SA` (beta), `tr-TR` (beta).\n\nUse the `checkFeatureStatus(...)` method to check whether the feature is available on the device for the configured mode and locale.\n\n## Compatibility\n\n| Plugin Version | Capacitor Version | Status         |\n| -------------- | ----------------- | -------------- |\n| 8.x.x          | >=8.x.x           | Active support |\n\n## Installation\n\nYou can use our **AI-Assisted Setup** to install the plugin.\nAdd the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:\n\n```bash\nnpx skills add capawesome-team/skills --skill capacitor-plugins\n```\n\nThen use the following prompt:\n\n```\nUse the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capacitor-mlkit/genai-speech-recognition` plugin in my project.\n```\n\nIf you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:\n\n```bash\nnpm install @capacitor-mlkit/genai-speech-recognition\nnpx cap sync\n```\n\n### Android\n\n#### API level\n\nThis plugin requires a minimum API level of 26. Make sure to set the `minSdkVersion` in your `variables.gradle` file to at least `26`. Note that the basic recognition mode is only supported on devices with API level 31 or higher.\n\n#### Permissions\n\nThe plugin declares the `android.permission.RECORD_AUDIO` permission in its manifest, so no manual configuration is needed. The microphone permission is requested automatically when you start a recognition session. You can also check and request the permission manually using the `checkPermissions()` and `requestPermissions()` methods.\n\n#### Variables\n\nThis plugin will use the following project variables (defined in your app’s `variables.gradle` file):\n\n- `$mlkitGenaiSpeechRecognitionVersion` version of `com.google.mlkit:genai-speech-recognition` (default: `1.0.0-alpha1`)\n- `$kotlinVersion` version of the Kotlin Gradle plugin (default: `2.2.20`)\n\n## Usage\n\nThe following example shows how to check the feature status, download the feature and run a speech recognition session.\n\n### Check the feature status\n\nBefore using the speech recognition feature, check whether it is available on the device. The feature availability depends on the configured mode and locale:\n\n```typescript\nimport {\n  FeatureStatus,\n  GenAiSpeechRecognition,\n  RecognitionMode,\n} from '@capacitor-mlkit/genai-speech-recognition';\n\nconst checkFeatureStatus = async () => {\n  const { featureStatus } = await GenAiSpeechRecognition.checkFeatureStatus({\n    locale: 'en-US',\n    mode: RecognitionMode.Basic,\n  });\n  return featureStatus === FeatureStatus.Available;\n};\n```\n\n### Download the feature\n\nIf the feature status is `DOWNLOADABLE`, download the feature before using it. Add a listener for the `downloadProgress` event to get notified about the download progress:\n\n```typescript\nimport { GenAiSpeechRecognition, RecognitionMode } from '@capacitor-mlkit/genai-speech-recognition';\n\nconst downloadFeature = async () => {\n  await GenAiSpeechRecognition.addListener('downloadProgress', event => {\n    console.log('Total bytes downloaded:', event.totalBytesDownloaded);\n  });\n  await GenAiSpeechRecognition.downloadFeature({\n    locale: 'en-US',\n    mode: RecognitionMode.Basic,\n  });\n};\n```\n\n### Start and stop a recognition session\n\nStart a recognition session with `startRecognition(...)`. The audio is captured from the device microphone and the microphone permission is requested automatically if it has not been granted yet. Add listeners for the `partialResult` and `finalResult` events to receive the recognition results and for the `error` event to get notified about errors that occur during the session:\n\n```typescript\nimport { GenAiSpeechRecognition, RecognitionMode } from '@capacitor-mlkit/genai-speech-recognition';\n\nconst startRecognition = async () => {\n  await GenAiSpeechRecognition.addListener('partialResult', event => {\n    console.log('Partial result:', event.text);\n  });\n  await GenAiSpeechRecognition.addListener('finalResult', event => {\n    console.log('Final result:', event.text);\n  });\n  await GenAiSpeechRecognition.addListener('error', event => {\n    console.error('Error:', event.message);\n  });\n  await GenAiSpeechRecognition.startRecognition({\n    locale: 'en-US',\n    mode: RecognitionMode.Basic,\n  });\n};\n\nconst stopRecognition = async () => {\n  await GenAiSpeechRecognition.stopRecognition();\n};\n```\n\n## API\n\n<docgen-index>\n\n* [`checkFeatureStatus(...)`](#checkfeaturestatus)\n* [`checkPermissions()`](#checkpermissions)\n* [`downloadFeature(...)`](#downloadfeature)\n* [`requestPermissions()`](#requestpermissions)\n* [`startRecognition(...)`](#startrecognition)\n* [`stopRecognition()`](#stoprecognition)\n* [`addListener('downloadProgress', ...)`](#addlistenerdownloadprogress-)\n* [`addListener('error', ...)`](#addlistenererror-)\n* [`addListener('finalResult', ...)`](#addlistenerfinalresult-)\n* [`addListener('partialResult', ...)`](#addlistenerpartialresult-)\n* [`removeAllListeners()`](#removealllisteners)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n* [Enums](#enums)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\n### checkFeatureStatus(...)\n\n```typescript\ncheckFeatureStatus(options?: FeatureOptions | undefined) => Promise<CheckFeatureStatusResult>\n```\n\nCheck the current availability status of the speech recognition feature.\n\nThe feature availability depends on the configured mode and locale.\nIf the status is `DOWNLOADABLE`, you can download the feature\nusing `downloadFeature(...)`.\n\nOnly available on Android.\n\n| Param         | Type                                                      |\n| ------------- | --------------------------------------------------------- |\n| **`options`** | <code><a href=\"#featureoptions\">FeatureOptions</a></code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#checkfeaturestatusresult\">CheckFeatureStatusResult</a>&gt;</code>\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### checkPermissions()\n\n```typescript\ncheckPermissions() => Promise<PermissionStatus>\n```\n\nCheck the status of the microphone permission.\n\nOnly available on Android.\n\n**Returns:** <code>Promise&lt;<a href=\"#permissionstatus\">PermissionStatus</a>&gt;</code>\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### downloadFeature(...)\n\n```typescript\ndownloadFeature(options?: FeatureOptions | undefined) => Promise<void>\n```\n\nDownload the speech recognition feature.\n\nThe `downloadProgress` event listener will notify you about\nthe download progress. The returned promise resolves when\nthe download is complete or the feature is already available.\n\nOnly available on Android.\n\n| Param         | Type                                                      |\n| ------------- | --------------------------------------------------------- |\n| **`options`** | <code><a href=\"#featureoptions\">FeatureOptions</a></code> |\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### requestPermissions()\n\n```typescript\nrequestPermissions() => Promise<PermissionStatus>\n```\n\nRequest the microphone permission.\n\nOnly available on Android.\n\n**Returns:** <code>Promise&lt;<a href=\"#permissionstatus\">PermissionStatus</a>&gt;</code>\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### startRecognition(...)\n\n```typescript\nstartRecognition(options?: FeatureOptions | undefined) => Promise<void>\n```\n\nStart a speech recognition session.\n\nThe audio is captured from the device microphone. If the microphone\npermission has not been granted yet, it will be requested automatically.\nThe `partialResult` and `finalResult` event listeners will notify you\nabout the recognition results. The `error` event listener will notify\nyou about errors that occur during the session.\n\nRejects with the `RECOGNITION_ALREADY_RUNNING` error code if a\nrecognition session is already running.\n\nOnly available on Android.\n\n| Param         | Type                                                      |\n| ------------- | --------------------------------------------------------- |\n| **`options`** | <code><a href=\"#featureoptions\">FeatureOptions</a></code> |\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### stopRecognition()\n\n```typescript\nstopRecognition() => Promise<void>\n```\n\nStop the current speech recognition session.\n\nOnly available on Android.\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### addListener('downloadProgress', ...)\n\n```typescript\naddListener(eventName: 'downloadProgress', listenerFunc: (event: DownloadProgressEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled while the speech recognition feature is being downloaded.\n\nOnly available on Android.\n\n| Param              | Type                                                                                        |\n| ------------------ | ------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'downloadProgress'</code>                                                             |\n| **`listenerFunc`** | <code>(event: <a href=\"#downloadprogressevent\">DownloadProgressEvent</a>) =&gt; void</code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### addListener('error', ...)\n\n```typescript\naddListener(eventName: 'error', listenerFunc: (event: ErrorEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when an error occurs during a recognition session.\n\nOnly available on Android.\n\n| Param              | Type                                                                  |\n| ------------------ | --------------------------------------------------------------------- |\n| **`eventName`**    | <code>'error'</code>                                                  |\n| **`listenerFunc`** | <code>(event: <a href=\"#errorevent\">ErrorEvent</a>) =&gt; void</code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### addListener('finalResult', ...)\n\n```typescript\naddListener(eventName: 'finalResult', listenerFunc: (event: RecognitionResultEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a final recognition result is available.\n\nOnly available on Android.\n\n| Param              | Type                                                                                          |\n| ------------------ | --------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'finalResult'</code>                                                                    |\n| **`listenerFunc`** | <code>(event: <a href=\"#recognitionresultevent\">RecognitionResultEvent</a>) =&gt; void</code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### addListener('partialResult', ...)\n\n```typescript\naddListener(eventName: 'partialResult', listenerFunc: (event: RecognitionResultEvent) => void) => Promise<PluginListenerHandle>\n```\n\nCalled when a partial recognition result is available.\n\nOnly available on Android.\n\n| Param              | Type                                                                                          |\n| ------------------ | --------------------------------------------------------------------------------------------- |\n| **`eventName`**    | <code>'partialResult'</code>                                                                  |\n| **`listenerFunc`** | <code>(event: <a href=\"#recognitionresultevent\">RecognitionResultEvent</a>) =&gt; void</code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginlistenerhandle\">PluginListenerHandle</a>&gt;</code>\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### removeAllListeners()\n\n```typescript\nremoveAllListeners() => Promise<void>\n```\n\nRemove all listeners for this plugin.\n\n**Since:** 8.2.0\n\n--------------------\n\n\n### Interfaces\n\n\n#### CheckFeatureStatusResult\n\n| Prop                | Type                                                    | Description                                                        | Since |\n| ------------------- | ------------------------------------------------------- | ------------------------------------------------------------------ | ----- |\n| **`featureStatus`** | <code><a href=\"#featurestatus\">FeatureStatus</a></code> | The current availability status of the speech recognition feature. | 8.2.0 |\n\n\n#### FeatureOptions\n\nThe feature availability depends on the configured mode and locale.\nTherefore, `checkFeatureStatus(...)` and `downloadFeature(...)` take\nthe same base options as `startRecognition(...)`.\n\n| Prop         | Type                                                        | Description                                                                                                          | Default                            | Since |\n| ------------ | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | ----- |\n| **`locale`** | <code>string</code>                                         | The locale of the speech to recognize as a BCP-47 language tag. The supported locales depend on the configured mode. | <code>The device locale.</code>    | 8.2.0 |\n| **`mode`**   | <code><a href=\"#recognitionmode\">RecognitionMode</a></code> | The speech recognition mode.                                                                                         | <code>RecognitionMode.Basic</code> | 8.2.0 |\n\n\n#### PermissionStatus\n\n| Prop             | Type                                                        | Description                              | Since |\n| ---------------- | ----------------------------------------------------------- | ---------------------------------------- | ----- |\n| **`microphone`** | <code><a href=\"#permissionstate\">PermissionState</a></code> | The status of the microphone permission. | 8.2.0 |\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |\n\n\n#### DownloadProgressEvent\n\n| Prop                       | Type                | Description                                  | Since |\n| -------------------------- | ------------------- | -------------------------------------------- | ----- |\n| **`totalBytesDownloaded`** | <code>number</code> | The total number of bytes downloaded so far. | 8.2.0 |\n\n\n#### ErrorEvent\n\n| Prop          | Type                | Description        | Since |\n| ------------- | ------------------- | ------------------ | ----- |\n| **`message`** | <code>string</code> | The error message. | 8.2.0 |\n\n\n#### RecognitionResultEvent\n\n| Prop       | Type                | Description          | Since |\n| ---------- | ------------------- | -------------------- | ----- |\n| **`text`** | <code>string</code> | The recognized text. | 8.2.0 |\n\n\n### Type Aliases\n\n\n#### PermissionState\n\n<code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>\n\n\n#### StartRecognitionOptions\n\n<code><a href=\"#featureoptions\">FeatureOptions</a></code>\n\n\n### Enums\n\n\n#### FeatureStatus\n\n| Members            | Value                       | Description                                                 | Since |\n| ------------------ | --------------------------- | ----------------------------------------------------------- | ----- |\n| **`Available`**    | <code>'AVAILABLE'</code>    | The feature is available to use.                            | 8.2.0 |\n| **`Downloadable`** | <code>'DOWNLOADABLE'</code> | The feature can be downloaded using `downloadFeature(...)`. | 8.2.0 |\n| **`Downloading`**  | <code>'DOWNLOADING'</code>  | The feature is currently being downloaded.                  | 8.2.0 |\n| **`Unavailable`**  | <code>'UNAVAILABLE'</code>  | The feature is not available on this device.                | 8.2.0 |\n\n\n#### RecognitionMode\n\n| Members        | Value                   | Description                                                                                                                                              | Since |\n| -------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |\n| **`Advanced`** | <code>'ADVANCED'</code> | Speech recognition using a GenAI model. This mode provides the best quality but is currently only available on a limited set of devices (e.g. Pixel 10). | 8.2.0 |\n| **`Basic`**    | <code>'BASIC'</code>    | Speech recognition using a traditional speech model. This mode requires Android API level 31 or higher.                                                  | 8.2.0 |\n\n</docgen-api>\n\n## FAQ\n\n### What are the requirements to use this plugin?\n\nThe speech recognition is performed entirely on-device. The basic mode requires Android API level 31 or higher. The advanced mode uses a GenAI model and is currently only available on a very limited set of devices (e.g. Pixel 10). Use the `checkFeatureStatus(...)` method to check whether the feature is available on the device (see [Requirements](#requirements)).\n\n### Why is this plugin only available on Android?\n\nThe ML Kit GenAI APIs are currently only available on Android. On iOS and Web, all methods reject with an appropriate error.\n\n### What is the difference between the basic and advanced mode?\n\nThe basic mode uses a traditional on-device speech model and is supported on Android devices with API level 31 or higher. The advanced mode uses a GenAI model, which provides the best quality but is currently only available on a very limited set of devices (e.g. Pixel 10). Each mode supports a different set of locales (see [Requirements](#requirements)).\n\n### How do I receive the recognition results?\n\nAdd listeners for the `partialResult` and `finalResult` events before calling `startRecognition(...)`. The `partialResult` event is called with intermediate results while the user is speaking. The `finalResult` event is called with the final recognized text.\n\n### Can I use this plugin with Ionic, React, Vue or Angular?\n\nYes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.\n\n## Related Plugins\n\n- [Translation](https://capawesome.io/docs/sdks/capacitor/mlkit/translation/): Unofficial Capacitor plugin for ML Kit Translation.\n- [Language Identification](https://capawesome.io/docs/sdks/capacitor/mlkit/language-identification/): Unofficial Capacitor plugin for ML Kit Language Identification.\n\n## Terms & Privacy\n\nThis plugin uses the [Google ML Kit](https://developers.google.com/ml-kit):\n\n- [Terms & Privacy](https://developers.google.com/ml-kit/terms)\n- [Android Data Disclosure](https://developers.google.com/ml-kit/android-data-disclosure)\n- [iOS Data Disclosure](https://developers.google.com/ml-kit/ios-data-disclosure)\n\n## Newsletter\n\nStay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/capawesome-team/capacitor-mlkit/blob/main/packages/genai-speech-recognition/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/capawesome-team/capacitor-mlkit/blob/main/packages/genai-speech-recognition/LICENSE).\n\n[^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by Google LLC or any of their affiliates or subsidiaries.\n","readmeFilename":"README.md"}