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

voice-recognition-react-native

v0.2.0

Published

voice recognition at react native

Readme

voice-recognition-react-native

Speech-to-text for React Native, built on the platform speech recognizers (iOS SFSpeechRecognizer, Android SpeechRecognizer) as a New Architecture TurboModule.

Requirements

  • React Native 0.76+ with the New Architecture enabled (the default since 0.76)

Installation

npm install voice-recognition-react-native
# or
yarn add voice-recognition-react-native

iOS

Add the usage descriptions to your Info.plist:

<key>NSSpeechRecognitionUsageDescription</key>
<string>We need access to speech recognition to transcribe your voice</string>
<key>NSMicrophoneUsageDescription</key>
<string>We need access to your microphone for speech recognition</string>

Then install pods:

cd ios && pod install

Android

Add the permission to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.RECORD_AUDIO" />

Usage

import { useEffect, useState } from 'react';
import { Button, SafeAreaView, Text } from 'react-native';
import {
  addRecognitionListener,
  startRecognition,
  stopRecognition,
} from 'voice-recognition-react-native';

export default function App() {
  const [transcription, setTranscription] = useState('');

  useEffect(() => {
    const subscription = addRecognitionListener(
      (result) => setTranscription(result),
      (error) => console.warn(error.code, error.message),
      (partial) => setTranscription(partial) // optional: live results
    );
    return () => subscription.remove();
  }, []);

  const handleStart = async () => {
    try {
      const finalResult = await startRecognition({ locale: 'en-US' });
      setTranscription(finalResult);
    } catch (error) {
      console.warn(error);
    }
  };

  return (
    <SafeAreaView>
      <Button title="Start" onPress={handleStart} />
      <Button title="Stop" onPress={() => stopRecognition()} />
      <Text>{transcription}</Text>
    </SafeAreaView>
  );
}

API

startRecognition(options?): Promise<string>

Starts speech recognition and resolves with the final transcription. On Android the microphone permission is requested automatically if needed.

| Option | Type | Default | Description | | -------- | -------- | --------- | ---------------------------------------- | | locale | string | 'en-US' | BCP-47 language tag, e.g. 'ko-KR' |

Rejections carry a code property: permission_denied, not_available, language_not_supported, no_match, network, speech_timeout, busy, audio_error, server_error, recognition_error.

stopRecognition(): void

Stops the current session. The pending startRecognition promise resolves with whatever was transcribed so far.

Sessions keep listening through pauses until you call stopRecognition(). On Android the platform recognizer ends after each utterance, so the library transparently restarts it and concatenates the segments. Note that on iOS, Apple's recognizer limits a single session to roughly one minute.

addRecognitionListener(onResult, onError, onPartialResult?): RecognitionSubscription

Subscribes to recognition events:

  • onResult(result: string) — final transcription of a session
  • onError(error: { code: string; message: string }) — recognition errors
  • onPartialResult(result: string) — live transcription while speaking (optional)

Returns a subscription; call subscription.remove() to unsubscribe. Multiple independent subscriptions can coexist.

requestRecognitionPermission(): Promise<boolean>

Requests the Android microphone permission up front (always resolves true on iOS, where the system prompts when recognition starts). Useful if you want to control when the permission dialog appears.

Contributing

License

MIT


Made with create-react-native-library