{"_id":"@ascendtis/react-native-voice-to-text","_rev":"3-902cfa3c7bb2e978a183cc4bbfca7f60","name":"@ascendtis/react-native-voice-to-text","dist-tags":{"latest":"0.3.2"},"versions":{"0.3.0":{"name":"@ascendtis/react-native-voice-to-text","version":"0.3.0","keywords":["react-native","ios","android","voice-to-text","speech-recognition","speech-to-text","voice-recognition","transcription","dictation","audio-recognition","stt","mobile","native-module"],"author":{"url":"https://github.com/sufyan297","name":"Mohammed Sufyan","email":"sufyan297@gmail.com"},"license":"MIT","_id":"@ascendtis/react-native-voice-to-text@0.3.0","maintainers":[{"name":"sufyan297","email":"sufyan297@gmail.com"}],"homepage":"https://github.com/sufyan297/react-native-voice-to-text#readme","bugs":{"url":"https://github.com/sufyan297/react-native-voice-to-text/issues"},"dist":{"shasum":"3fee4af22e367807a022d21a15026f2100d9e410","tarball":"https://registry.npmjs.org/@ascendtis/react-native-voice-to-text/-/react-native-voice-to-text-0.3.0.tgz","fileCount":43,"integrity":"sha512-isz++wTyF6S1LHaiCnPL3Sdo7KhTrcg9KrytArvcTNT9kR2AXpdX0pdU+8E9zoT7rlmdNKC0AnEKqF0vqnRuhw==","signatures":[{"sig":"MEUCIQDTu+07OoOdpleov2R5PKsloJTqbmojjt4xYLlfFTCoFgIgCKbt2NX6O2rWtodYsFO5p0SVefIX8bTceMWZfyEef+s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":90288},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"./lib/commonjs/index.js","module":"./lib/module/index.js","source":"./src/index.tsx","exports":{".":{"import":{"types":"./lib/typescript/module/src/index.d.ts","default":"./lib/module/index.js"},"require":{"types":"./lib/typescript/commonjs/src/index.d.ts","default":"./lib/commonjs/index.js"}}},"gitHead":"5d0a8e95c7ec4aa84d1b5f8275a3a64ffe7cd3ab","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","example":"yarn workspace react-native-voice-to-text-example","prepare":"bob build","release":"release-it","typecheck":"tsc"},"_npmUser":{"name":"sufyan297","email":"sufyan297@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":{"name":"angular"}}}},"repository":{"url":"git+https://github.com/sufyan297/react-native-voice-to-text.git","type":"git"},"workspaces":["example"],"_npmVersion":"9.5.0","description":"This can use to convert voice to text real time in device","directories":{},"resolutions":{"@types/react":"^18.2.44","@rollup/rollup-darwin-arm64":"4.37.0","@rollup/rollup-linux-x64-gnu":"4.37.0"},"_nodeVersion":"18.15.0","eslintConfig":{"root":true,"rules":{"prettier/prettier":["error",{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"}],"react/react-in-jsx-scope":"off"},"extends":["@react-native","prettier"]},"eslintIgnore":["node_modules/","lib/"],"codegenConfig":{"name":"RNVoiceToTextSpec","type":"modules","android":{"javaPackageName":"com.voicetotext"},"jsSrcsDir":"src","outputDir":{"ios":"ios/generated","android":"android/generated"},"includesGeneratedCode":true},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"jest":"^29.7.0","react":"19.0.0","turbo":"^1.10.7","eslint":"^8.51.0","del-cli":"^5.1.0","prettier":"^3.0.3","commitlint":"^19.6.1","release-it":"^17.10.0","typescript":"^5.2.2","@types/jest":"^29.5.5","@types/react":"^19.0.12","react-native":"0.78.1","@types/react-native":"^0.73.0","@evilmartians/lefthook":"^1.5.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","react-native-builder-bob":"^0.36.0","@react-native-community/cli":"15.0.1","@react-native/eslint-config":"^0.73.1","@commitlint/config-conventional":"^19.6.0","@release-it/conventional-changelog":"^9.0.2"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-voice-to-text_0.3.0_1748506993197_0.4102789204989974","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["codegen",["commonjs",{"esm":true}],["module",{"esm":true}],["typescript",{"esm":true,"project":"tsconfig.build.json"}]]},"create-react-native-library":{"type":"turbo-module","version":"0.48.5","languages":"kotlin-objc"}},"0.3.1":{"name":"@ascendtis/react-native-voice-to-text","version":"0.3.1","keywords":["react-native","ios","android","voice-to-text","speech-recognition","speech-to-text","voice-recognition","transcription","dictation","audio-recognition","stt","mobile","native-module"],"author":{"url":"https://github.com/sufyan297","name":"Mohammed Sufyan","email":"sufyan297@gmail.com"},"license":"MIT","_id":"@ascendtis/react-native-voice-to-text@0.3.1","maintainers":[{"name":"sufyan297","email":"sufyan297@gmail.com"}],"homepage":"https://github.com/sufyan297/react-native-voice-to-text#readme","bugs":{"url":"https://github.com/sufyan297/react-native-voice-to-text/issues"},"dist":{"shasum":"7695a07633d03ed7c63ab15d91b9624bc81fe687","tarball":"https://registry.npmjs.org/@ascendtis/react-native-voice-to-text/-/react-native-voice-to-text-0.3.1.tgz","fileCount":43,"integrity":"sha512-P8snUrDpeXBpp/JYOytCni21puYHmQ4v4GqM21Lv8darhV9Hg93sr1czKCrH5vo9rsPzD9xpLgHiNugIUfj1wg==","signatures":[{"sig":"MEUCIQCwkxymKviX3nJSvWm9utlUM0nhTrp3slr54a3tbWS7CgIgLcliSJwKFlXyMT4kriuKcT6Rqktq63FCYIw5pqUEP3c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":90331},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"./lib/commonjs/index.js","module":"./lib/module/index.js","source":"./src/index.tsx","exports":{".":{"import":{"types":"./lib/typescript/module/src/index.d.ts","default":"./lib/module/index.js"},"require":{"types":"./lib/typescript/commonjs/src/index.d.ts","default":"./lib/commonjs/index.js"}}},"gitHead":"c8f3646eb54516e93471ac63e7db0afc3da50ef1","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","example":"yarn workspace react-native-voice-to-text-example","prepare":"bob build","release":"release-it","typecheck":"tsc"},"_npmUser":{"name":"sufyan297","email":"sufyan297@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":{"name":"angular"}}}},"repository":{"url":"git+https://github.com/sufyan297/react-native-voice-to-text.git","type":"git"},"workspaces":["example"],"_npmVersion":"9.5.0","description":"This can use to convert voice to text real time in device","directories":{},"resolutions":{"@types/react":"^18.2.44","@rollup/rollup-darwin-arm64":"4.37.0","@rollup/rollup-linux-x64-gnu":"4.37.0"},"_nodeVersion":"18.15.0","eslintConfig":{"root":true,"rules":{"prettier/prettier":["error",{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"}],"react/react-in-jsx-scope":"off"},"extends":["@react-native","prettier"]},"eslintIgnore":["node_modules/","lib/"],"codegenConfig":{"name":"RNVoiceToTextSpec","type":"modules","android":{"javaPackageName":"com.voicetotext"},"jsSrcsDir":"src","outputDir":{"ios":"ios/generated","android":"android/generated"},"includesGeneratedCode":true},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"jest":"^29.7.0","react":"19.0.0","turbo":"^1.10.7","eslint":"^8.51.0","del-cli":"^5.1.0","prettier":"^3.0.3","commitlint":"^19.6.1","release-it":"^17.10.0","typescript":"^5.2.2","@types/jest":"^29.5.5","@types/react":"^19.0.12","react-native":"0.78.1","@types/react-native":"^0.73.0","@evilmartians/lefthook":"^1.5.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","react-native-builder-bob":"^0.36.0","@react-native-community/cli":"15.0.1","@react-native/eslint-config":"^0.73.1","@commitlint/config-conventional":"^19.6.0","@release-it/conventional-changelog":"^9.0.2"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-voice-to-text_0.3.1_1748523356694_0.88860366195582","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["codegen",["commonjs",{"esm":true}],["module",{"esm":true}],["typescript",{"esm":true,"project":"tsconfig.build.json"}]]},"create-react-native-library":{"type":"turbo-module","version":"0.48.5","languages":"kotlin-objc"}},"0.3.2":{"name":"@ascendtis/react-native-voice-to-text","version":"0.3.2","description":"This can use to convert voice to text real time in device","source":"./src/index.tsx","main":"./lib/commonjs/index.js","module":"./lib/module/index.js","exports":{".":{"import":{"types":"./lib/typescript/module/src/index.d.ts","default":"./lib/module/index.js"},"require":{"types":"./lib/typescript/commonjs/src/index.d.ts","default":"./lib/commonjs/index.js"}}},"scripts":{"example":"yarn workspace react-native-voice-to-text-example","test":"jest","typecheck":"tsc","lint":"eslint \"**/*.{js,ts,tsx}\"","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","prepare":"bob build","release":"release-it"},"keywords":["react-native","ios","android","voice-to-text","speech-recognition","speech-to-text","voice-recognition","transcription","dictation","audio-recognition","stt","mobile","native-module"],"repository":{"type":"git","url":"git+https://github.com/sufyan297/react-native-voice-to-text.git"},"author":{"name":"Mohammed Sufyan","email":"sufyan297@gmail.com","url":"https://github.com/sufyan297"},"license":"MIT","bugs":{"url":"https://github.com/sufyan297/react-native-voice-to-text/issues"},"homepage":"https://github.com/sufyan297/react-native-voice-to-text#readme","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"devDependencies":{"@commitlint/config-conventional":"^19.6.0","@evilmartians/lefthook":"^1.5.0","@react-native-community/cli":"15.0.1","@react-native/eslint-config":"^0.73.1","@release-it/conventional-changelog":"^9.0.2","@types/jest":"^29.5.5","@types/react":"^19.0.12","@types/react-native":"^0.73.0","commitlint":"^19.6.1","del-cli":"^5.1.0","eslint":"^8.51.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","jest":"^29.7.0","prettier":"^3.0.3","react":"19.0.0","react-native":"0.78.1","react-native-builder-bob":"^0.36.0","release-it":"^17.10.0","turbo":"^1.10.7","typescript":"^5.2.2"},"resolutions":{"@types/react":"^18.2.44","@rollup/rollup-linux-x64-gnu":"4.37.0","@rollup/rollup-darwin-arm64":"4.37.0"},"peerDependencies":{"react":"*","react-native":"*"},"workspaces":["example"],"packageManager":"yarn@3.6.1","jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":{"name":"angular"}}}},"eslintConfig":{"root":true,"extends":["@react-native","prettier"],"rules":{"react/react-in-jsx-scope":"off","prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["codegen",["commonjs",{"esm":true}],["module",{"esm":true}],["typescript",{"project":"tsconfig.build.json","esm":true}]]},"codegenConfig":{"name":"RNVoiceToTextSpec","type":"modules","jsSrcsDir":"src","outputDir":{"ios":"ios/generated","android":"android/generated"},"android":{"javaPackageName":"com.voicetotext"},"includesGeneratedCode":true},"create-react-native-library":{"type":"turbo-module","languages":"kotlin-objc","version":"0.48.5"},"gitHead":"17b50fe1a998e01e3186a67ac33a1762b9881cec","_id":"@ascendtis/react-native-voice-to-text@0.3.2","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-KpLZLhLN80Dtd2cKVDFvtG15TT/kDpykmgPknnpYdbxGJ3i7h5rGksErVTVUkQ09QhOs1/4AYHkY9RSQY1PF/Q==","shasum":"31f13529d2a9df4b1502e80c068f1e149aec6d4d","tarball":"https://registry.npmjs.org/@ascendtis/react-native-voice-to-text/-/react-native-voice-to-text-0.3.2.tgz","fileCount":43,"unpackedSize":90857,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDrZcfpJCGQyIFRhq1okwhu7vSS5VQCF5dKCKn2H69HlgIgV3C37++jTzTwbIpSFU7n407bBMF2xNb/rpFARTtGSto="}]},"_npmUser":{"name":"sufyan297","email":"sufyan297@gmail.com"},"directories":{},"maintainers":[{"name":"sufyan297","email":"sufyan297@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-voice-to-text_0.3.2_1748609009628_0.6737811174794881"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-29T08:23:13.122Z","modified":"2025-05-30T12:43:29.995Z","0.3.0":"2025-05-29T08:23:13.389Z","0.3.1":"2025-05-29T12:55:56.878Z","0.3.2":"2025-05-30T12:43:29.801Z"},"bugs":{"url":"https://github.com/sufyan297/react-native-voice-to-text/issues"},"author":{"name":"Mohammed Sufyan","email":"sufyan297@gmail.com","url":"https://github.com/sufyan297"},"license":"MIT","homepage":"https://github.com/sufyan297/react-native-voice-to-text#readme","keywords":["react-native","ios","android","voice-to-text","speech-recognition","speech-to-text","voice-recognition","transcription","dictation","audio-recognition","stt","mobile","native-module"],"repository":{"type":"git","url":"git+https://github.com/sufyan297/react-native-voice-to-text.git"},"description":"This can use to convert voice to text real time in device","maintainers":[{"name":"sufyan297","email":"sufyan297@gmail.com"}],"readme":"# react-native-voice-to-text\n\nConvert voice to text in React Native using native speech recognition capabilities on both iOS and Android.\n\n## Features\n\n- Utilize the device's native speech recognition API\n- Support for multiple languages\n- Real-time partial results as the user speaks\n- Volume level detection\n- Detailed transcription results with confidence scores\n- Cross-platform compatibility (iOS and Android)\n- Written in TypeScript with full type definitions\n\n## Installation\n\n```sh\nnpm install react-native-voice-to-text\n```\n\n## Permissions\n\n### iOS\nYou need to add the following permissions to your `Info.plist`:\n\n```xml\n<key>NSMicrophoneUsageDescription</key>\n<string>This app needs access to your microphone for speech recognition</string>\n<key>NSSpeechRecognitionUsageDescription</key>\n<string>This app needs access to speech recognition to convert your voice to text</string>\n```\n\n### Android\nAdd the following permission to your `AndroidManifest.xml`:\n\n```xml\n<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />\n```\n\nFor Android 6.0+ (API level 23), you also need to request the permission at runtime:\n\n```js\nimport { Platform, PermissionsAndroid } from 'react-native';\n\n// Request microphone permission\nasync function requestMicrophonePermission() {\n  if (Platform.OS !== 'android') return true;\n\n  try {\n    const granted = await PermissionsAndroid.request(\n      PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,\n      {\n        title: 'Microphone Permission',\n        message: 'This app needs access to your microphone for speech recognition',\n        buttonPositive: 'OK',\n      }\n    );\n    return granted === PermissionsAndroid.RESULTS.GRANTED;\n  } catch (err) {\n    console.warn(err);\n    return false;\n  }\n}\n```\n\n## API Reference\n\n### Methods\n\n| Method | Description | Return Type |\n|--------|-------------|-------------|\n| `startListening()` | Start speech recognition | `Promise<string>` |\n| `stopListening()` | Stop speech recognition | `Promise<string>` |\n| `destroy()` | Clean up speech recognition resources | `Promise<string>` |\n| `getRecognitionLanguage()` | Get current recognition language | `Promise<string>` |\n| `setRecognitionLanguage(languageTag)` | Set recognition language (e.g., 'en-US') | `Promise<boolean>` |\n| `isRecognitionAvailable()` | Check if speech recognition is available on device | `Promise<boolean>` |\n| `getSupportedLanguages()` | Get list of supported language codes | `Promise<string[]>` |\n| `addEventListener(eventName, callback)` | Add event listener | `EmitterSubscription` |\n| `removeAllListeners(eventName)` | Remove all listeners for event | `void` |\n\n### Events\n\n| Event | Description | Data |\n|-------|-------------|------|\n| `VoiceToTextEvents.START` | Speech recognition started | `null` |\n| `VoiceToTextEvents.BEGIN` | User began speaking | `null` |\n| `VoiceToTextEvents.END` | Speech recognition ended | `null` |\n| `VoiceToTextEvents.ERROR` | Error occurred | `{ code: number, message: string }` |\n| `VoiceToTextEvents.RESULTS` | Final results obtained | `{ value: string, results: { transcriptions: Array<{ text: string, confidence: number }> } }` |\n| `VoiceToTextEvents.PARTIAL_RESULTS` | Partial results as user speaks | `{ value: string, results: { transcriptions: Array<{ text: string }> } }` |\n| `VoiceToTextEvents.VOLUME_CHANGED` | Volume level changed | `{ value: number }` |\n| `VoiceToTextEvents.AUDIO_BUFFER` | Raw audio buffer available | `{ buffer: string }` (Base64 encoded) |\n\n## Basic Usage\n\n```js\nimport React, { useEffect, useState } from 'react';\nimport { View, Button, Text } from 'react-native';\nimport VoiceToText, { VoiceToTextEvents } from 'react-native-voice-to-text';\n\nexport default function SpeechRecognitionExample() {\n  const [results, setResults] = useState('');\n  const [isListening, setIsListening] = useState(false);\n  \n  useEffect(() => {\n    // Set up event listeners\n    const resultsListener = VoiceToText.addEventListener(\n      VoiceToTextEvents.RESULTS,\n      (event) => {\n        setResults(event.value);\n      }\n    );\n    \n    const startListener = VoiceToText.addEventListener(\n      VoiceToTextEvents.START,\n      () => setIsListening(true)\n    );\n    \n    const endListener = VoiceToText.addEventListener(\n      VoiceToTextEvents.END,\n      () => setIsListening(false)\n    );\n    \n    // Clean up\n    return () => {\n      VoiceToText.destroy();\n      resultsListener.remove();\n      startListener.remove();\n      endListener.remove();\n    };\n  }, []);\n  \n  const toggleListening = async () => {\n    try {\n      if (isListening) {\n        await VoiceToText.stopListening();\n      } else {\n        await VoiceToText.startListening();\n      }\n    } catch (error) {\n      console.error(error);\n    }\n  };\n  \n  return (\n    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>\n      <Text>{results || 'Say something...'}</Text>\n      <Button\n        title={isListening ? 'Stop' : 'Start'}\n        onPress={toggleListening}\n      />\n    </View>\n  );\n}\n```\n\n## Known Issues and Fixes\n\n### Android\n- **Thread Error**: SpeechRecognizer operations must run on the main thread in Android. This is handled internally in the latest version.\n- **Type Conversion**: ArrayList type conversion for language lists is now properly handled.\n\n### iOS\n- Speech recognition requires user permission prompt which is handled via Info.plist settings.\n\n## License\n\nMIT\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n","readmeFilename":"README.md"}