npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rn-voice-to-text

v0.1.0

Published

React Native voice-to-text (speech recognition) library

Readme

rn-voice-to-text

A React Native native module for speech recognition (voice-to-text) with TypeScript support for Android and iOS.

Features

  • 🎤 Real-time speech recognition with partial and final results
  • 📱 Cross-platform support for Android and iOS
  • 🔗 Auto-linking support (React Native ≥ 0.64)
  • 🎯 TypeScript type definitions included
  • Promise-based API with event emitters
  • 🌍 Multi-language support
  • 🔒 Permission handling for microphone and speech recognition
  • 📦 Zero dependencies (peer dependencies only)
  • 🎵 Audio file transcription (iOS only - see platform limitations below)

Installation

npm install rn-voice-to-text
# or
yarn add rn-voice-to-text

For React Native ≥ 0.64, the library will auto-link. After installation, rebuild your app:

# iOS
cd ios && pod install && cd ..
npx react-native run-ios

# Android
npx react-native run-android

Platform Setup

iOS Setup

Add the following permissions to your ios/YourApp/Info.plist:

<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to the microphone for speech recognition</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>This app needs access to speech recognition</string>

Android Setup

The library automatically adds required permissions. You must request RECORD_AUDIO permission at runtime using requestPermissions().

Usage

Basic Example

import VoiceToText from 'rn-voice-to-text';

const hasPermission = await VoiceToText.requestPermissions();
if (hasPermission) {
  await VoiceToText.startListening({ language: 'en-US' });
}
await VoiceToText.stopListening();

Event Listeners

VoiceToText.addEventListener('onResult', (result) => {
  console.log('Final:', result.transcript);
});

VoiceToText.addEventListener('onPartialResult', (result) => {
  console.log('Partial:', result.transcript);
});

VoiceToText.addEventListener('onError', (error) => {
  console.error(error.code, error.message);
});

API Reference

Methods

startListening(options?: VoiceToTextOptions): Promise<void>

Starts speech recognition.

interface VoiceToTextOptions {
  language?: string;        // default: 'en-US'
  maxResults?: number;      // default: 5
  partialResults?: boolean; // default: true
  continuous?: boolean;     // default: false
  timeout?: number;         // default: 30000
}

stopListening(): Promise<void>

Stops recognition and returns final results.

cancel(): Promise<void>

Cancels recognition without returning results.

isListening(): Promise<boolean>

Checks if currently listening.

requestPermissions(): Promise<boolean>

Requests microphone and speech permissions.

checkPermissions(): Promise<boolean>

Checks if permissions are granted.

Events

  • onStart: Recognition started
  • onPartialResult: Partial results available
  • onResult: Final results available
  • onError: Error occurred
  • onEnd: Recognition ended

Error Codes

AUDIO, CLIENT, INSUFFICIENT_PERMISSIONS, NETWORK, NETWORK_TIMEOUT, NO_MATCH, RECOGNIZER_BUSY, SERVER, SPEECH_TIMEOUT, NOT_AVAILABLE, UNKNOWN

Supported Languages

Common language codes: en-US, en-GB, es-ES, fr-FR, de-DE, it-IT, ja-JP, ko-KR, zh-CN, pt-BR, ru-RU, ar-SA, hi-IN

Platform Differences

Android: Uses android.speech.SpeechRecognizer, provides confidence scores, works offline with language packs

iOS: Uses SFSpeechRecognizer with AVAudioEngine, requires iOS 12.0+, may need internet

Requirements

  • React Native ≥ 0.64.0
  • Android: minSdkVersion 21
  • iOS: iOS 12.0+

License

MIT

Author

afzaal