{"_id":"@crossplatformkorea/expo-stt","_rev":"1-7df417e72953b109cb8ef151ed605ade","name":"@crossplatformkorea/expo-stt","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.3":{"name":"@crossplatformkorea/expo-stt","version":"0.0.3","keywords":["react-native","expo","expo-stt","ExpoStt"],"author":{"url":"https://github.com/anhtuank7c","name":"Tuan Nguyen Anh","email":"anhtuank7c@hotmail.com"},"license":"MIT","_id":"@crossplatformkorea/expo-stt@0.0.3","maintainers":[{"name":"dooboolab","email":"dooboolab@gmail.com"}],"homepage":"https://github.com/anhtuank7c/expo-stt#readme","bugs":{"url":"https://github.com/anhtuank7c/expo-stt/issues"},"dist":{"shasum":"ac1b1ea696e00009ebdc0c57e11d19c79d05399a","tarball":"https://registry.npmjs.org/@crossplatformkorea/expo-stt/-/expo-stt-0.0.3.tgz","fileCount":37,"integrity":"sha512-1VSWt7R1xTuMTZmgxzTqt+Z2EAgT+1V7JPZqp5EJh2CjwZsBl1Qc7s6WZXz7LyzcQfxnf5a79rNg8sVI/e0bEw==","signatures":[{"sig":"MEQCIFO0zEnBayogeBPDYSg5487fvEhn6RL+zahnUhJ7/y9OAiAlBuoDeEiSKr3HoUagZi5FMZG651SL0DIbFq1YD9ky9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43904},"jest":{"preset":"expo-module-scripts"},"main":"build/index.js","types":"build/index.d.ts","gitHead":"d46b39e9138054e9285220175eb385bcaf948766","scripts":{"lint":"expo-module lint","test":"expo-module test","build":"expo-module build","clean":"expo-module clean","prepare":"expo-module prepare","open:ios":"open -a \"Xcode\" example/ios","expo-module":"expo-module","open:android":"open -a \"Android Studio\" example/android","prepublishOnly":"expo-module prepublishOnly"},"_npmUser":{"name":"dooboolab","email":"dooboolab@gmail.com"},"repository":{"url":"git+https://github.com/anhtuank7c/expo-stt.git","type":"git"},"_npmVersion":"10.8.0","description":"Unofficial Speech To Text module for Expo which supported iOS and Android","directories":{},"_nodeVersion":"20.10.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/react":"^18.0.25","expo-modules-core":"^1.1.0","@types/react-native":"^0.70.6","expo-module-scripts":"^3.0.4"},"peerDependencies":{"expo":"*","react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/expo-stt_0.0.3_1716215713278_0.44423220517209683","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@crossplatformkorea/expo-stt","version":"0.0.4","description":"Unofficial Speech To Text module for Expo which supports iOS and Android","main":"build/index.js","types":"build/index.d.ts","publishConfig":{"access":"public"},"scripts":{"build":"expo-module build","clean":"expo-module clean","lint":"expo-module lint","test":"expo-module test","prepare":"expo-module prepare","prepublishOnly":"expo-module prepublishOnly","expo-module":"expo-module","open:ios":"open -a \"Xcode\" example/ios","open:android":"open -a \"Android Studio\" example/android"},"keywords":["react-native","expo","expo-stt","ExpoStt"],"repository":{"type":"git","url":"git+https://github.com/crossplatformkorea/expo-stt.git"},"bugs":{"url":"https://github.com/crossplatformkorea/expo-stt/issues"},"author":{"name":"Cross-Platform Korea","email":"crossplatformkorea@gmail.com","url":"https://github.com/crossplatformkorea"},"license":"MIT","homepage":"https://github.com/crossplatformkorea/expo-stt#readme","jest":{"preset":"expo-module-scripts"},"dependencies":{},"devDependencies":{"@types/react":"^18.0.25","expo-module-scripts":"^3.5.2","expo-modules-core":"^1.12.14"},"peerDependencies":{"expo":"*","react":"*","react-native":"*"},"_id":"@crossplatformkorea/expo-stt@0.0.4","gitHead":"bd8fa6107e01fe14b20d1a40f357531e72640cb1","_nodeVersion":"20.18.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-YFJ2BvqoQ/Qu/0J41NVVQ6l165jAdP/7anru4wRm0vThg5ZYNUl05RJA7ljq8w0lXTCU52HsilRcJ/Ie2EGk4Q==","shasum":"54d7135b45d60d6307d76902cbedae73e7005959","tarball":"https://registry.npmjs.org/@crossplatformkorea/expo-stt/-/expo-stt-0.0.4.tgz","fileCount":39,"unpackedSize":862752,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMco2gyVHwhWLbQg35yi/du8piTfFG9XUD2SIUXXWIhwIhAKMD5lXZO+jgUfue3Uk0I1gX77ti+4N6mAkBjaArBgGA"}]},"_npmUser":{"name":"dooboolab","email":"dooboolab@gmail.com"},"directories":{},"maintainers":[{"name":"dooboolab","email":"dooboolab@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/expo-stt_0.0.4_1729526795802_0.9506193679661374"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-20T14:35:13.156Z","modified":"2024-10-21T16:06:36.271Z","0.0.3":"2024-05-20T14:35:13.434Z","0.0.4":"2024-10-21T16:06:36.067Z"},"bugs":{"url":"https://github.com/crossplatformkorea/expo-stt/issues"},"author":{"name":"Cross-Platform Korea","email":"crossplatformkorea@gmail.com","url":"https://github.com/crossplatformkorea"},"license":"MIT","homepage":"https://github.com/crossplatformkorea/expo-stt#readme","keywords":["react-native","expo","expo-stt","ExpoStt"],"repository":{"type":"git","url":"git+https://github.com/crossplatformkorea/expo-stt.git"},"description":"Unofficial Speech To Text module for Expo which supports iOS and Android","maintainers":[{"name":"dooboolab","email":"dooboolab@gmail.com"}],"readme":"# expo-stt\n\n- Unofficial Speech To Text module for Expo which supported iOS and Android\n- Forked [anhtuank7c/expo-stt](https://github.com/anhtuank7c/expo-stt)\n- Migrated [react-native-voice functionality](https://github.com/react-native-voice/voice) on [crossplatformkorea/expo-stt](https://github.com/crossplatformkorea/expo-stt), which is forked from [anhtuank7c/expo-stt](https://github.com/anhtuank7c/expo-stt)\n- Currently, [anhtuank7c/expo-stt](https://github.com/anhtuank7c/expo-stt) has a separate Google voice recognition modal. Instead, I migrated the [react-native-voice](https://github.com/react-native-voice/voice) code onto [crossplatformkorea/expo-stt](https://github.com/crossplatformkorea/expo-stt), which was created with the [expo module](https://docs.expo.dev/modules/overview), to use the built-in microphone like [react-native-voice](https://github.com/react-native-voice/voice).\n\n# Sequence Diagram\n\nBelow is a sequence diagram explaining how each module, including SpeechRecognizer, works.\n\n![Sequence Diagram](sequence-diagram.png)\n\nAnd below is the [mermaid](https://mermaid.js.org) code to create the above diagram.\n\n```mermaid\n\nsequenceDiagram\n    participant User\n    participant ExpoSttModule\n    participant SpeechRecognizer\n    participant ReactNative as React Native Module\n\n    User->>ExpoSttModule: startSpeech()\n    ExpoSttModule->>SpeechRecognizer: createSpeechRecognizer()\n    ExpoSttModule->>SpeechRecognizer: startListening()\n    SpeechRecognizer-->>ExpoSttModule: onReadyForSpeech\n\n    User->>SpeechRecognizer: User starts speaking\n    SpeechRecognizer-->>ExpoSttModule: onBeginningOfSpeech\n    ExpoSttModule->>ReactNative: sendEvent(onSpeechStart)\n\n    User->>SpeechRecognizer: User finishes speaking\n    SpeechRecognizer-->>ExpoSttModule: onEndOfSpeech\n    ExpoSttModule->>ReactNative: sendEvent(onSpeechEnd)\n\n    SpeechRecognizer-->>ExpoSttModule: onResults\n    ExpoSttModule->>ReactNative: sendEvent(onSpeechResult)\n\n    alt SpeechRecognizer encounters an error\n        SpeechRecognizer-->>ExpoSttModule: onError\n        ExpoSttModule->>ReactNative: sendEvent(onSpeechError)\n    end\n```\n\n# Demo\n\n![Demo speech to text](demo.png \"Demo Speech To Text\")\n\n### Add the package to your npm dependencies\n\n```\nnpm install expo-stt\nor\nyarn add expo-stt\n```\n\nRemember, this module doesn't support [Expo Go](https://expo.dev/expo-go).\nSo for Expo project, you will need to [generates native code](https://docs.expo.dev/workflow/prebuild/#clean) (Bare React Native project can skip this step)\n\n```\nnpx expo prebuild --clean\n```\n\n### Configure for iOS (Bare React Native project only)\n\nRun `npx pod-install` after installing the npm package.\n\n## Add missing permissions for iOS\n\nAdd following key to plugins of `app.json` in Expo project\nThis is an optional, just use in case you want to customize the permission string\n\n```\n  \"plugins\": [\n    [\n      \"expo-stt\",\n      {\n        \"microphonePermission\": \"Allow $(PRODUCT_NAME) to access your microphone\",\n        \"speechRecognitionPermission\": \"Allow $(PRODUCT_NAME) to access your speech recognition\"\n      }\n    ]\n  ]\n```\n\nFor Bare React Native project, you need to add these key to `Info.plist` in `ios` directory\n\n```\n  <key>NSMicrophoneUsageDescription</key>\n  <string>Allow $(PRODUCT_NAME) to access your microphone</string>\n  <key>NSSpeechRecognitionUsageDescription</key>\n  <string>Allow $(PRODUCT_NAME) to access your speech recognition</string>\n```\n\n## Usage\n\nRegister some listeners\n\n```\n  import * as ExpoStt from 'expo-stt';\n\n  useEffect(() => {\n    const onSpeechStart = ExpoStt.addOnSpeechStartListener(() => {\n      setSpokenText(\"\");\n      setError(undefined);\n      setRecognizing(true);\n    });\n\n    const onSpeechResult = ExpoStt.addOnSpeechResultListener(({ value }) => {\n      setSpokenText(value.join());\n    });\n\n    const onSpeechError = ExpoStt.addOnSpeechErrorListener(({ cause }) => {\n      setError(cause);\n      setRecognizing(false);\n    });\n\n    const onSpeechEnd = ExpoStt.addOnSpeechEndListener(() => {\n      setRecognizing(false);\n    });\n\n    return () => {\n      onSpeechStart.remove();\n      onSpeechResult.remove();\n      onSpeechError.remove();\n      onSpeechEnd.remove();\n    };\n  }, []);\n```\n\nThere are some functions available to call such as:\n\n- ExpoStt.startSpeech()\n- ExpoStt.stopSpeech()\n- ExpoStt.destroySpeech()\n- ExpoStt.requestRecognitionPermission()\n- ExpoStt.checkRecognitionPermission()\n\nTake a look into `example/App.tsx` for completed example\n\n# Contributing\n\nContributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).\n","readmeFilename":"README.md"}