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

Leopard Speech-to-Text
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. Set up the React Native environment.

  2. Install the npm packages:

    • @picovoice/leopard-react-native
npm install @picovoice/leopard-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" />

Model File

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

Android

To add a Leopard Speech-to-Text 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 Speech-to-Text 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 Leopard Speech-to-Text using a custom model from Picovoice console or using a default model.

import {Leopard, LeopardErrors} from '@picovoice/leopard-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 leopard = await Leopard.create(accessKey, modelPath)
} catch (err: any) {
if (err instanceof LeopardErrors) {
// handle error
}
}

Transcribe an audio file by providing an absolute path to the file:

const { transcript, words } = await leopard.processFile("${AUDIO_FILE_PATH}")
console.log(transcript)

Transcribe raw audio data (sample rate of 16 kHz, 16-bit linearly encoded and 1 channel):

const getAudioData = () => {
// ...
}
const { transcript, words } = await leopard.process(getAudioData())
console.log(transcript)

Free resources used by Leopard Speech-to-Text:

leopard.delete()

Word Metadata

Along with the transcript, Leopard Speech-to-Text returns metadata for each transcribed word. Available metadata items are:

  • Start Time: Indicates when the word started in the transcribed audio. Value is in seconds.
  • End Time: Indicates when the word ended in the transcribed audio. Value is in seconds.
  • Confidence: Leopard Speech-to-Text's confidence that the transcribed word is accurate. It is a number within [0, 1].
  • Speaker Tag: If speaker diarization is enabled on initialization, the speaker tag is a non-negative integer identifying unique speakers, with 0 reserved for unknown speakers. If speaker diarization is not enabled, the value will always be -1.

Demo

For the Leopard Speech-to-Text 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/leopard.git

Usage

  1. Install dependencies and setup environment:
cd leopard/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 Leopard Speech-to-Text demos for React Native, head over to our GitHub repository.

Resources

Package

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

API

  • @picovoice/leopard-react-native API Docs

GitHub

  • Leopard Speech-to-Text React Native SDK on GitHub
  • Leopard Speech-to-Text React Native demo on GitHub

Benchmark

  • Speech-to-Text Benchmark

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Leopard Speech-to-Text React Native Quick Start
  • Platforms
  • Requirements
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Model File
  • Usage
  • Word Metadata
  • 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.