Installation
After installing the package, you need to install the iOS dependencies:Microphone Permissions
If you want to use realtime transcription features, you need to add microphone permissions.Add to Info.plist
Add the microphone usage description toios/[YOUR_APP_NAME]/Info.plist:
For tvOS, please note that the microphone is not supported.
Request Permission at Runtime
Use React Native’s PermissionsIOS API to request permission:Audio Session Management
whisper.rn provides utilities to manage iOS Audio Session settings for optimal recording quality and compatibility with other audio playback.Available Categories
Ambient- Mix with other audio, no recordingSoloAmbient- Interrupt other audio, no recordingPlayback- For playback onlyRecord- For recording onlyPlayAndRecord- Recommended for realtime transcriptionMultiRoute- Multiple audio routes
Available Options
MixWithOthers- Mix with other apps’ audioDuckOthers- Lower other apps’ audio volumeInterruptSpokenAudioAndMixWithOthersAllowBluetoothA2DP- Enable Bluetooth A2DPAllowAirPlay- Enable AirPlayAllowBluetooth- Enable Bluetooth (iOS only, not tvOS)DefaultToSpeaker- Route to speaker by default (iOS only, not tvOS)
Available Modes
Default- Default modeVoiceChat- Optimized for voice chatVideoChat- Optimized for video chatGameChat- Optimized for game chatVideoRecording- Optimized for video recordingMeasurement- For audio measurementMoviePlayback- For movie playbackSpokenAudio- For podcasts/audiobooks
Manual Audio Session Management
You can manually configure the audio session before starting transcription:Automatic Session Management (Deprecated API)
If using the deprecatedtranscribeRealtime API, you can configure audio session automatically:
Core ML Support
Core ML significantly accelerates the encoder on iOS 15.0+ and tvOS 15.0+.Model Requirements
Core ML models are loaded based on your GGML model path:- GGML model:
ggml-tiny.en.bin - Core ML model:
ggml-tiny.en-encoder.mlmodelc/
Core ML Model Structure
The.mlmodelc directory contains these files:
Downloading Core ML Models
Core ML models are available from Hugging Face: https://huggingface.co/ggerganov/whisper.cpp/tree/mainModels are distributed as zip archives. You’ll need to unzip them at runtime using a library like react-native-zip-archive.
Bundling Core ML Models
You can bundle Core ML models in your app (increases app size significantly):Disabling Core ML
To disable Core ML even when model files exist:Metal GPU Acceleration
Metal acceleration is enabled by default on iOS and tvOS for significant performance improvements.Enabling/Disabling Metal
Control Metal acceleration at runtime:Extended Virtual Addressing
For medium or large models, enable the Extended Virtual Addressing capability in your Xcode project:
This allows your app to use more memory for larger models.
Build Configuration
Pre-built Framework (Default)
By default, whisper.rn usesios/rnwhisper.xcframework which includes:
- Pre-compiled whisper.cpp bindings
- Metal shaders (
.metallib) - Optimized builds for all iOS/tvOS architectures
- ✅ Faster build times
- ✅ Smaller build artifacts
- ✅ Consistent performance
Building from Source
To build from source, add to your Podfile beforepod install:
- Debugging native code
- Contributing to whisper.rn
- Customizing whisper.cpp configuration
Building from source increases build time significantly but gives you full control over compilation flags.
Minimum Versions
- iOS: 11.0+
- tvOS: 11.0+
- Core ML: iOS 15.0+ / tvOS 15.0+
Platform Limitations
Performance Tips
- Use Core ML - 2-3x faster encoder on supported devices
- Enable Metal - Significant GPU acceleration
- Test in Release mode - Debug builds are much slower
- Use quantized models - Smaller size, faster inference
- Choose appropriate model size - tiny/base for most mobile use cases
Troubleshooting
Build errors
Clean derived data and rebuild:Core ML not working
Check that:- iOS version is 15.0+
.mlmodelcdirectory is properly located- All required files exist in
.mlmodelc/ useCoreMLIosis not set tofalse