Picovoice WordmarkPicovoice Console
Introduction
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSNodejsPythonRaspberry PiReact NativeRustWebWindows
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
FAQ
Introduction
AndroidCiOSLinuxmacOSPythonWebWindows
AndroidCiOSPythonWeb
SummaryOctopus Speech-to-IndexGoogle Speech-to-TextMozilla DeepSpeech
FAQ
Introduction
AndroidAngularArduinoBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaMicrocontrollerNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidAngularBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonlinuxmacOSNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidBeagleboneCiOSNvidia JetsonLinuxmacOSPythonRaspberry PiRustWebWindows
AndroidCiOSPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidAngularArduinoBeagleBoneC.NETFlutterlink to GoiOSJavaNvidia JetsonMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustUnityVueWeb
AndroidAngularCMicrocontroller.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
Picovoice SDK - FAQ
IntroductionSTM32F407G-DISC1 (Arm Cortex-M4)STM32F411E-DISCO (Arm Cortex-M4)STM32F769I-DISCO (Arm Cortex-M7)IMXRT1050-EVKB (Arm Cortex-M7)
FAQGlossary

Cheetah Speech-to-Text
React Native Quick Start


Platforms

  • Android 5.0+ (API 21+)
  • iOS 10.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/cheetah-react-native
npm install @picovoice/cheetah-react-native
  1. Enable the proper permissions 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" />

Adding Cheetah Models

Create a custom model using the Picovoice Console or use the default model.

Android

To add a Leopard model file to your Android application, add the file as a bundled resource by placing it under the assets directory of your Android application.

iOS

To add a Leopard model file to your iOS application, add the file as a bundled resource by selecting Build Phases in Xcode and adding it to the Copy Bundle Resources step.

Usage

Create an instance of Cheetah using a custom model from Picovoice console or a default model.

import {Cheetah, CheetahErrors} from '@picovoice/cheetah-react-native';
const accessKey = "{ACCESS_KEY}" // AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
const modelPath = "{CHEETAH_MODEL_PATH}" // path relative to the assets folder or absolute path to file on device
try {
const cheetah = await Cheetah.create(accessKey, modelPath)
} catch (err: any) {
if (err instanceof CheetahErrors) {
// handle error
}
}

Transcribe real-time audio:

const getAudioFrame = () => {
// get audio frames
}
const transcript = ""
try {
while (1) {
const partialResult = await cheetah.process(getAudioFrame())
transcript += partialResult.transcript
if (partialResult.isEndpoint) {
const finalResult = await cheetah.flush()
transcript += finalTranscript.transcript
}
}
} catch (err: any) {
if (err instanceof CheetahErrors) {
// handle error
}
}

Free resources used by Cheetah:

cheetah.delete()

Demo

For the Cheetah React Native SDK, there is a React Native demo project available on the Picovoice GitHub repository.

Setup

Clone the Picovoice repository from GitHub:

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

Usage

  1. Install dependencies and setup environment:
cd cheetah/demo/react-native
npm run android-install
# or
npm run ios-install
  1. Connect a mobile device or launch a simulator and run:
npm run android-run
# or
npm run ios-run

For more information on our Cheetah demos for React Native, head over to our GitHub repository.

Resources

Package

  • @picovoice/cheetah-react-native on the npm registry

API

  • @picovoice/cheetah-react-native API Docs

GitHub

  • Cheetah React Native SDK on GitHub
  • Cheetah React Native demo on GitHub

Benchmark

  • Speech-to-Text Benchmark

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Cheetah Speech-to-Text React Native Quick Start
  • Platforms
  • Requirements
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Adding Cheetah Models
  • Usage
  • Demo
  • Setup
  • Usage
  • Resources
Platform
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Octopus Speech-to-Index
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Resources
  • Docs
  • Console
  • Blog
  • Demos
Sales
  • Pricing
  • Starter Tier
  • Enterprise
Company
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • Twitter
  • Medium
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2022 Picovoice Inc.