whisper.rn  by mybigday

React Native binding for high-performance local speech recognition

created 2 years ago
587 stars

Top 56.1% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides React Native bindings for whisper.cpp, enabling high-performance speech-to-text inference directly within mobile applications. It targets React Native developers seeking to integrate advanced Automatic Speech Recognition (ASR) capabilities, offering both file-based and real-time transcription.

How It Works

The library leverages whisper.cpp's C++ core for efficient Whisper model execution. It exposes JavaScript APIs for initializing the Whisper context with model files and performing transcription tasks. For iOS, it supports leveraging Core ML for hardware-accelerated inference, falling back to the GGML model if necessary.

Quick Start & Requirements

  • Install: npm install whisper.rn
  • iOS: Run npx pod-install. Extended Virtual Addressing recommended for medium/large models. Microphone permission required for real-time transcription.
  • Android: Add Proguard rule if enabled. NDK version 24.0.8215888+ recommended. Microphone permission required for real-time transcription.
  • Expo: Requires prebuilding.
  • Docs: https://github.com/mybigday/whisper.rn

Highlighted Details

  • Supports both file-based and real-time audio transcription.
  • Integrates Core ML for optimized iOS performance.
  • Allows bundling model and audio files as assets (requires Metro config modification).
  • Provides utilities for managing iOS Audio Sessions.

Maintenance & Community

  • Built and maintained by BRICKS.
  • Contributing guide available.

Licensing & Compatibility

  • MIT License. Permissive for commercial use and closed-source linking.

Limitations & Caveats

Bundling large models as assets can significantly increase app size; quantized models are recommended for the RN packager due to file size limits. Core ML models are separate assets that need to be managed. Real-time transcription on tvOS is not supported.

Health Check
Last commit

2 weeks ago

Responsiveness

1 day

Pull Requests (30d)
5
Issues (30d)
18
Star History
48 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.