jamsch/expo-speech-recognition

Speech Recognition for React Native Expo projects

What it solves

expo-speech-recognition provides a unified API for implementing speech-to-text functionality in React Native projects. It solves the problem of fragmented native speech recognition APIs across iOS, Android, and the Web, allowing developers to write a single codebase that works across all three platforms.

How it works

The library acts as a wrapper around the native speech recognition services of each platform:

  • iOS: Uses SFSpeechRecognizer.
  • Android: Uses SpeechRecognizer.
  • Web: Uses the SpeechRecognition API.

It provides a set of hooks (like useSpeechRecognitionEvent) and a direct module API (ExpoSpeechRecognitionModule) to start, stop, and manage speech recognition sessions. It handles permissions, event-driven results (interim and final), and platform-specific configurations such as on-device recognition and audio session categories.

Who it’s for

React Native and Expo developers who need to integrate voice input or transcription services into their mobile and web applications without writing platform-specific native code.

Highlights

  • Cross-platform support: Unified interface for iOS, Android, and Web.
  • Flexible transcription: Supports both real-time (interim) results and final transcriptions.
  • Audio persistence: Ability to save audio recordings to local files on Android 13+ and iOS.
  • File-based transcription: Supports transcribing existing audio files from a local URI.
  • Advanced controls: Includes volume metering, language detection (Android 14+), and the ability to to force on-device recognition to prevent network audio transmission.
  • Customization: Allows providing contextual strings to improve recognition accuracy for specific app-related terms.

Related

  • Project
  • Project
  • Project
  • Project
  • Project