Class Cheetah

java.lang.Object
ai.picovoice.cheetah.Cheetah

public class Cheetah extends Object
Cheetah Class.
  • Field Details

    • LIBRARY_PATH

      public static final String LIBRARY_PATH
    • MODEL_PATH

      public static final String MODEL_PATH
  • Method Details

    • setSdk

      public static void setSdk(String sdk)
    • delete

      public void delete()
      Releases resources acquired by Cheetah.
    • process

      public CheetahTranscript process(short[] pcm) throws CheetahException
      Processes given audio data and returns its transcription.
      Parameters:
      pcm - A frame of audio samples. 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 only.
      Returns:
      Inferred transcription.
      Throws:
      CheetahException - if there is an error while processing the audio frame.
    • flush

      public CheetahTranscript flush() throws CheetahException
      Processes any remaining audio data and returns its transcription.
      Returns:
      Inferred transcription.
      Throws:
      CheetahException - if there is an error while processing the audio frame.
    • getFrameLength

      public int getFrameLength()
      Getter for required number of audio samples per frame.
      Returns:
      Required number of audio samples per frame.
    • getSampleRate

      public int getSampleRate()
      Getter for required audio sample rate for PCM data.
      Returns:
      Required audio sample rate for PCM data.
    • getVersion

      public String getVersion()
      Getter for Cheetah version.
      Returns:
      Cheetah version.