@gmessier/nitro-speech
v0.4.6
Published
React Native real-time Speech Recognition Library powered by Nitro Modules
Maintainers
Readme
@gmessier/nitro-speech
React Native real-time Speech Recognition Library powered by Nitro Modules
⚠️ This is @gmessier/nitro-speech package (npm). This package will be deprecated soon. Please switch to the new react-native-nitro-speech (npm)
The API is identical — no migration needed.
Key Features:
- ⚡ Built with Nitro Modules for low-overhead native binding
- 🌎 Supports 60+ languages
- 🍎 The only library implementing new
SpeechAnalyzerwithSpeechTranscriberorDictationTranscriberAPI for iOS 26+ (with fallback to legacySFSpeechRecognitionfor older versions) - 🧵 Full support of
react-native-worklets- each method is accessible from any runtime - ⏱️ Timer for silence
- Configurable and mutable
autoFinishRecognitionMsvalue (default: 8 sec) - Callback
onAutoFinishProgressfires periodically with a configurable interval - Configurable and mutable interval
autoFinishProgressIntervalMsvalue (default: 1 sec) allows changing the value on the fly - Method
resetAutoFinishTimeresets the timer to the threshold - Method
addAutoFinishTimeadds ms once without changing threshold - Configurable volume-based sensitivity
resetAutoFinishVoiceSensitivityfor the timer from 0 to 1
- Configurable and mutable
- 🎤 Rich user voice input management
- Hook
useVoiceInputVolumeand methodgetVoiceInputVolumefor displaying volume in dB and making smooth UI animations - Callback
onVolumeChangefor advanced use cases
- Hook
- 🧩 Session Lifecycle methods:
prewarmandupdateConfig - 👆 Configurable Haptic Feedback on start and finish
- 🎚️ Speech-quality features: see full list here
- 🔓 Embedded Permission handling
- Callback
onPermissionDeniedand methodgetPermissions - Option
requestPermissionforprewarmmethod
- Callback
- 📦 Everything else that could be found in Expo or other libraries
Table of Contents
- Installation
- Permissions
- Features
- Requirements
- Compatibility
- Contributions and feedback
- Troubleshooting
- Usage:
Installation
npm install @gmessier/nitro-speech react-native-nitro-modules
# or
yarn add @gmessier/nitro-speech react-native-nitro-modules
# or
bun add @gmessier/nitro-speech react-native-nitro-modulesExpo
This library works with Expo. You need to run prebuild to generate native code:
npx expo prebuildNote: Make sure New Arch is enabled in your Expo configuration before running prebuild.
iOS
cd ios && pod installAndroid
No additional setup required.
Permissions
More about permissions here
Android
No actions required.
The library declares the required permission in its AndroidManifest.xml (merged automatically):
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.VIBRATE" />iOS
Add the following keys to your app's Info.plist:
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for speech recognition</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>This app needs speech recognition to convert speech to text</string>Both permissions are required for speech recognition to work on iOS.
Features
| Feature | Documentation page | iOS | Android | | --------------------------------- | ------------------------------------------------------------------------------- | ------- | -------- | | Real-time transcription | Link 🔗 | ✅ | ✅ | | Full worklets support | Link 🔗 | ✅ | ✅ | | New advanced iOS models | Link 🔗 | ✅ | ✅ | | Locale support | Link 🔗 | ✅ | ✅ | | Auto-finish on silence | Link 🔗 | ✅ | ✅ | | Auto-finish progress | Link 🔗 | ✅ | ✅ | | Auto-finish progress interval | Link 🔗 | ✅ | ✅ | | Add Auto-finish Time | Link 🔗 | ✅ | ✅ | | Reset Auto-finish Time | Link 🔗 | ✅ | ✅ | | Reset Auto-finish Sensitivity | Link 🔗 | ✅ | ✅ | | Voice input volume | Link 🔗 | ✅ | ✅ | | Prewarm | Link 🔗 | ✅ | ✅ | | Update config | Link 🔗 | ✅ | ✅ | | Active state | Link 🔗 | ✅ | ✅ | | Haptic feedback | Link 🔗 | ✅ | ✅ | | Permission handling | Link 🔗 | ✅ | ✅ | | Background handling | Link 🔗 | ✅ | ✅ | | Repeating word filter | Link 🔗 | ✅ | ✅ | | Offensive word masking | Link 🔗 | iOS 26+ | ✅ | | Contextual strings | Link 🔗 | ✅ | ✅ | | Language model selection | Link 🔗 | Auto | ✅ | | Batch handling | Link 🔗 | Auto | ✅ | | Formatting quality | Link 🔗 | Auto | ✅ | | Transcription preset | Link 🔗 | ✅ | Auto | | Automatic punctuation | Link 🔗 | ✅ | Auto | | Atypical speech hint | Link 🔗 | ✅ | Auto | | getSupportedLocalesIOS | Link 🔗 | ✅ | X |
Requirements
- React Native >= 0.76
- New Arch Only
- react-native-nitro-modules
Compatibility
react-native-nitro-modules published a version 0.35.0 that is incompatible with older versions.
If your project can't migrate to the latest version of react-native-nitro-modules, you can use the older versions of @gmessier/nitro-speech
| nitro-speech | react-native-nitro-modules |
| ----------------------------------| -------------------------------------- |
| @gmessier/nitro-speech < 0.3.* | react-native-nitro-modules < 0.35.0 |
| @gmessier/nitro-speech >= 0.3.* | react-native-nitro-modules >= 0.35.0 |
| react-native-nitro-speech * | react-native-nitro-modules >= 0.35.0 |
Contributions and feedback
If you hit an issue or want to request a feature, please open a GitHub issue or reach out to me on Discord / Twitter (X) — response is guaranteed.
- GitHub Issues
- Twitter (X)
- Discord:
@gmessier
Troubleshooting
Android Gradle sync issues
If you're having issues with Android Gradle sync, try running the prebuild for the library that causes the issue:
e.g. failed in react-native-nitro-modules:
cd android && ./gradlew :react-native-nitro-modules:preBuilde.g. failed in react-native-worklets:
cd android && ./gradlew :react-native-worklets:preBuildLicense
MIT
