Package ai.picovoice.cheetah
Class Cheetah
- java.lang.Object
-
- ai.picovoice.cheetah.Cheetah
-
public class Cheetah extends java.lang.ObjectAndroid binding for Cheetah Speech-to-Text engine.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCheetah.BuilderBuilder 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 voiddelete()Releases resources acquired by Cheetah.CheetahTranscriptflush()Processes any remaining audio data and returns its transcription.intgetFrameLength()Getter for required number of audio samples per frame.intgetSampleRate()Getter for required audio sample rate for PCM data.java.lang.StringgetVersion()Getter for Cheetah version.CheetahTranscriptprocess(short[] pcm)Processes given audio data and returns its transcription.
-
-
-
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 callinggetFrameLength(). The incoming audio needs to have a sample rate equal togetSampleRate()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.
-
-