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

Cheetah Speech-to-Text
Java API

API Reference for the Java Cheetah SDK (cheetah-java)

package: ai.picovoice.cheetah


Cheetah

public class Cheetah { }

Class for the Cheetah Speech-to-Text engine.

Cheetah must be initialized using the Builder() Class. Resources should be cleaned when you are done using the delete() function.


Cheetah.delete()

public void delete()

Releases resources acquired by Cheetah.


Cheetah.getFrameLength()

public int getFrameLength()

Getter for number of audio samples per frame.

Returns

  • int: Number of audio samples per frame.

Cheetah.getSampleRate()

public int getSampleRate()

Getter for required audio sample rate for PCM data.

Returns

  • int: Required audio sample rate for PCM data.

Cheetah.getVersion()

public String getVersion()

Getter for version.

Returns

  • String: Current Cheetah version.

Cheetah.process()

public CheetahTranscript process(short[] pcm) throws CheetahException

Processes a frame of audio and returns newly-transcribed text and a flag indicating if an endpoint has been detected. Upon detection of an endpoint, the client may invoke .flush() to retrieve any remaining transcription.

The number of samples per frame can be attained by calling .getFrameLength(). The incoming audio needs to have a sample rate equal to .getSampleRate() and be 16-bit linearly-encoded. Furthermore, Cheetah operates on single-channel audio.

Parameters

  • pcm short[] : A frame of audio samples.

Returns

  • CheetahTranscript: Inferred transcription object.

Throws

  • CheetahException: If there is an error while processing the audio frame.

Cheetah.flush()

public CheetahTranscript flush() throws CheetahException

Processes any remaining audio data and returns its transcription.

Returns

  • CheetahTranscript: Inferred transcription object.

Throws

  • CheetahException: If there is an error while processing the audio frame.

Cheetah.Builder

public static class Builder {
public Builder(String accessKey) { }
}

Builder for creating an instance of Cheetah with a mixture of default arguments.

Parameters

  • accessKey String : AccessKey obtained from Picovoice Console.

Cheetah.Builder.build()

public Cheetah build() throws CheetahException

Creates an instance of Cheetah Speech-to-Text engine.

Returns

  • Cheetah: An instance of Cheetah Speech-to-Text engine.

Throws

  • CheetahException: If an error occurs while creating an instance of Cheetah Speech-to-Text engine.

Cheetah.Builder.setAccessKey()

public Cheetah.Builder setAccessKey(String accessKey)

Sets the AccessKey of the builder.

Parameters

  • accessKey String : AccessKey obtained from Picovoice Console.

Returns

  • Cheetah.Builder: Modified Cheetah.Builder object.

Cheetah.Builder.setModelPath()

public Cheetah.Builder setModelPath(String modelPath)

Sets the model path of the builder.

Parameters

  • modelPath String : Absolute path to the file containing model parameters (.pv).

Returns

  • Cheetah.Builder: Modified Cheetah.Builder object.

Cheetah.Builder.setLibraryPath()

public Builder setLibraryPath(String libraryPath)

Sets the library path of the builder.

Parameters

  • libraryPath String : Absolute path to the native Cheetah library.

Returns

  • Cheetah.Builder: Modified Cheetah.Builder object.

Cheetah.Builder.setEndpointDuration()

public Cheetah.Builder setEndpointDuration(float endpointDuration)

Sets the endpoint duration of the builder. A speech endpoint is detected when there is a chunk of audio (with a duration specified herein) after an utterance without any speech in it. Set duration to 0 to disable this. Default is 1 second.

Parameters

  • endpointDuration float : Duration of endpoint in seconds.

Returns

  • Cheetah.Builder: Modified Cheetah.Builder object.

Cheetah.Builder.setEnableAutomaticPunctuation()

public Cheetah.Builder setEnableAutomaticPunctuation(boolean setEnableAutomaticPunctuation)

Setter for enabling automatic punctuation insertion.

Parameters

  • enableAutomaticPunctuation boolean : Set to true to enable automatic punctuation insertion.

Returns

  • Cheetah.Builder: Modified Cheetah.Builder object.

CheetahTranscript

public class CheetahTranscript { }

Class that contains Cheetah transcript data.


CheetahTranscript.getTranscript()

public string getTranscript() { }

Getter for transcript data.

Returns

  • string: Inferred transcription.

CheetahTranscript.getIsEndpoint()

public boolean getIsEndpoint() { }

Getter for isEndpoint flag.

Returns

  • boolean: If true, Cheetah detected a speech endpoint.

CheetahException

public class CheetahException extends Exception { }

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

Exceptions:

public class CheetahActivationException extends CheetahException { }
public class CheetahActivationLimitException extends CheetahException { }
public class CheetahActivationRefusedException extends CheetahException { }
public class CheetahActivationThrottledException extends CheetahException { }
public class CheetahIOException extends CheetahException { }
public class CheetahInvalidArgumentException extends CheetahException { }
public class CheetahInvalidStateException extends CheetahException { }
public class CheetahKeyException extends CheetahException { }
public class CheetahMemoryException extends CheetahException { }
public class CheetahRuntimeException extends CheetahException { }
public class CheetahStopIterationException extends CheetahException { }

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Cheetah Speech-to-Text Java API
  • Cheetah
  • delete()
  • getFrameLength()
  • getSampleRate()
  • getVersion()
  • process()
  • flush()
  • Cheetah.Builder
  • build()
  • setAccessKey()
  • setModelPath()
  • setLibraryPath()
  • setEndpointDuration()
  • setEnableAutomaticPunctuation()
  • CheetahTranscript
  • getTranscript()
  • getIsEndpoint()
  • CheetahException
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.