Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Rhino Speech-to-Intent
React Native Quick Start

Platforms

  • Android (5.0+, API 21+)
  • iOS (13.0+)

Requirements

  • Picovoice Account and AccessKey
  • React Native 0.62.2+

Picovoice Account & AccessKey

Signup or Login to Picovoice Console to get your AccessKey. Make sure to keep your AccessKey secret.

Quick Start

Setup

  1. Setup the React Native environment.

  2. Install the npm packages:

    • @picovoice/rhino-react-native
    • @picovoice/react-native-voice-processor
npm install @picovoice/react-native-voice-processor @picovoice/rhino-react-native
  1. Enable the proper permission for recording with the hardware's microphone on both iOS and Android:

iOS

Open your Info.plist and add the following line:

<key>NSMicrophoneUsageDescription</key>
<string>[Permission explanation]</string>

Android

Open your AndroidManifest.xml and add the following line:

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

Usage

Request audio recording permissions from the user:

const recordAudioRequest = async () => {
if (Platform.OS == 'android') {
// Android requires an explicit call to ask for permission
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
{
title: 'Microphone Permission',
message: '[Permission explanation]',
buttonNeutral: 'Ask Me Later',
buttonNegative: 'Cancel',
buttonPositive: 'OK',
}
);
return (granted === PermissionsAndroid.RESULTS.GRANTED)
} else {
// iOS will automatically ask for permission
return true;
}
};
const hasPermission = await recordAudioRequest();

Create an instance of RhinoManager that infers intent from spoken commands within a given context:

import {RhinoManager} from '@picovoice/rhino-react-native';
let inferenceCallback = (inference) => {
if (inference.isUnderstood) {
let intent = inference.intent;
let slots = inference.slots;
// take action based on inferred intent and slot values
} else {
// handle unsupported commands
}
};
let rhinoManager = await RhinoManager.create(
"${ACCESS_KEY}",
"${CONTEXT_FILE_PATH}",
inferenceCallback
);

Once you have instantiated a RhinoManager, you can start audio capture and intent inference by calling:

let didStart = await this._rhinoManager.process();

When RhinoManager returns an inference result via the inferenceCallback, it will automatically stop audio capture for you. When you wish to result, call .process() again.

Once your app is done with using RhinoManager, be sure you explicitly release the resources allocated for it:

await rhinoManager.delete();
To use your own audio processing engine, check out the Low-Level Rhino API.

Custom Contexts

Create a custom context using the Picovoice Console. Download the custom context file (.rhn) and add it to the platform projects:

  • Android custom models must be added to ./android/app/src/main/assets/.

  • iOS custom models can be added anywhere under ./ios, but they must be included as a bundled resource in XCode by right-clicking on the Navigation tab, and clicking Add Files To ....

Alternatively, if the context file is deployed to the device with a different method, the absolute path to the file on device can be used.

Non-English Languages

Use the corresponding model file (.pv), to detect non-English wake words. The model files for all supported languages are available on the Rhino Speech-to-Intent GitHub repository.

Add the model file to your assets/resource directory and pass in the relative path using the modelPath argument:

let rhinoManager = await RhinoManager.create(
"${ACCESS_KEY}",
"${CONTEXT_FILE_PATH}",
inferenceCallback,
processErrorCallback,
"${MODEL_FILE_PATH}"
);

Alternatively, if the model file is deployed to the device with a different method, the absolute path to the file on device can be used.

Demo

For the Rhino Speech-to-Intent React Native SDK, there is a React Native demo project available on the Rhino GitHub repository.

Setup

Clone the Rhino Speech-to-Intent repository from GitHub:

git clone --recurse-submodules https://github.com/Picovoice/rhino.git

Usage

  1. Install dependencies and setup environment:
cd rhino/demo/react-native
npm run android-install
# or
npm run ios-install
  1. Connect a mobile device or launch a simulator. Then run the android-run or ios-run and replace ${LANGUAGE} with the language code of your choice (e.g. de -> German, ko -> Korean). To see a list of available languages, command without a language code.
npm run android-run ${LANGUAGE}
# or
npm run ios-run ${LANGUAGE}

For more information on our Rhino Speech-to-Intent demos for React Native, head over to our GitHub repository.

Resources

Packages

  • @picovoice/rhino-react-native on the npm registry
  • @picovoice/react-native-voice-processor on the npm registry

API

  • @picovoice/rhino-react-native API Docs

GitHub

  • Rhino Speech-to-Intent React Native SDK on GitHub
  • Rhino Speech-to-Intent React Native Demo on GitHub

Benchmark

  • Speech-to-Intent Benchmark

Further Reading

  • Add Voice Recognition to React Native Without Adding the Cloud

Video

  • React Native Clock App with Offline Voice Recognition

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Rhino Speech-to-Intent React Native Quick Start
  • Platforms
  • Requirements
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Usage
  • Custom Contexts
  • Non-English Languages
  • Demo
  • Setup
  • Usage
  • Resources
Voice AI
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.