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 API

API Reference for the React Native Leopard SDK (npm)


Leopard

class Leopard { }

Class for the Leopard Speech-to-Text engine.


Leopard.create()

public static async create(
accessKey: string,
modelPath: string,
options: LeopardOptions = {}
): Promise<Leopard>

Leopard constructor.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • modelPath string : Path to the file containing model parameters (.pv). Can be either a path that is relative to the assets/resource folder or an absolute path to the file on device.
  • options LeopardOptions : Optional configuration arguments:
    • enableAutomaticPunctuation boolean : Whether to enable automatic punctuation.
    • enableDiarization boolean : Whether to enable diarization. Set to true to enable speaker diarization, which allows Leopard to differentiate speakers as part of the transcription process. Word metadata will include a speakerTag to identify unique speakers.

Returns

  • Promise<Leopard>: An instance of Leopard platform.

Leopard.delete()

async delete()

Releases resources acquired by Leopard.


Leopard.sampleRate

get sampleRate()

Getter for audio sample rate accepted by Leopard.

Returns

  • number: Audio sample rate accepted by Leopard.

Leopard.version

get version()

Getter for version.

Returns

  • string: Current Leopard version.

Leopard.process()

async process(frame: number[]): Promise<LeopardTranscript>

Processes given audio data with the speech-to-text engine. The incoming audio needs to have a sample rate equal to .sampleRate and be 16-bit linearly-encoded. Leopard operates on single-channel audio.

Parameters

  • frame number[] : A frame of audio samples.

Returns

  • Promise<LeopardTranscript>: LeopardTranscript object which contains the transcription results of the engine.

Leopard.processFile()

async processFile(audioPath: string): Promise<string>

Processes an audio file with the speech-to-text engine.

Parameters

  • audioPath string : Absolute path to the audio file. The supported formats are: 3gp (AMR), FLAC, MP3, MP4/m4a (AAC), Ogg, WAV and WebM.

Returns

  • Promise<LeopardTranscript>: LeopardTranscript object which contains the transcription results of the engine.

LeopardError

class LeopardError extends Error { }

Exception thrown if an error occurs within Leopard Speech-to-Text engine.

Exceptions:

class LeopardActivationError extends LeopardError { }
class LeopardActivationLimitError extends LeopardError { }
class LeopardActivationRefusedError extends LeopardError { }
class LeopardActivationThrottledError extends LeopardError { }
class LeopardIOError extends LeopardError { }
class LeopardInvalidArgumentError extends LeopardError { }
class LeopardInvalidStateError extends LeopardError { }
class LeopardKeyError extends LeopardError { }
class LeopardMemoryError extends LeopardError { }
class LeopardRuntimeError extends LeopardError { }
class LeopardStopIterationError extends LeopardError { }

LeopardOptions

type LeopardOptions = {
enableAutomaticPunctuation?: boolean;
enableDiarization?: boolean;
}

Class containing optional configuration parameters for Leopard.

  • enableAutomaticPunctuation boolean : Flag to enable automatic punctuation insertion.
  • enableDiarization boolean : Flag to enable diarization.

LeopardTranscript

type LeopardTranscript = {
transcript: string;
words: LeopardWord[];
}

Class containing results from a Leopard process function.

  • transcript string : Inferred transcription.
  • words LeopardWord[] : Transcribed words and their associated metadata.

LeopardWord

type LeopardWord = {
word: string;
startSec: number;
endSec: number;
confidence: number;
speakerTag: number;
}

Class containing results word transcribed by Leopard and their associated metadata.

  • word string : Transcribed word.
  • startSec number : Start of word in seconds.
  • endSec number : End of word in seconds.
  • confidence number : Transcription confidence. It is a number within [0, 1].
  • speakerTag number : Speaker tag is -1 if diarization is not enabled during initialization; otherwise, it's a non-negative integer identifying unique speakers, with 0 reserved for unknown speakers.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Leopard Speech-to-Text React Native API
  • Leopard
  • create()
  • delete()
  • sampleRate
  • version
  • process()
  • processFile()
  • LeopardError
  • LeopardOptions
  • LeopardTranscript
  • LeopardWord
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.