Class Cheetah


  • public class Cheetah
    extends java.lang.Object
    Android binding for Cheetah Speech-to-Text engine.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Cheetah.Builder
      Builder for creating an instance of Cheetah with a mixture of default arguments.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete()
      Releases resources acquired by Cheetah.
      CheetahTranscript flush()
      Processes any remaining audio data and returns its transcription.
      int getFrameLength()
      Getter for required number of audio samples per frame.
      int getSampleRate()
      Getter for required audio sample rate for PCM data.
      java.lang.String getVersion()
      Getter for Cheetah version.
      CheetahTranscript process​(short[] pcm)
      Processes given audio data and returns its transcription.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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 java.lang.String getVersion()
        Getter for Cheetah version.
        Returns:
        Cheetah version.