Cheetah Speech-to-Text
Flutter API
API Reference for the Flutter Cheetah SDK (pub.dev)
Cheetah
Class for the Cheetah Speech-to-Text engine. Cheetah can be initialized using the creator.
Resources should be cleaned when you are done using the delete()
function.
Cheetah.create()
Static creator for initializing Cheetah.
Parameters
accessKeyString : AccessKey obtained from Picovoice Console.modelPathString : Path to the file containing model parameters (.pv). Can be relative to assets folder or an absolute path to the file on device.endpointDurationdouble? : (Optional) Duration of endpoint in seconds. 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.enableAutomaticPunctuationbool? : (Optional) Set totrueto enable automatic punctuation insertion.
Returns
Future<Cheetah>an instance of the speech-to-text engine.
Throws
CheetahException: If not initialized correctly.
Cheetah.process()
Process a frame of pcm audio with the speech-to-text engine.
Parameters
frameList<int> : a frame of audio samples to be assessed by Cheetah. The required audio format is found by calling.sampleRateto get the required sample rate and.frameLengthto get the required frame size. Audio must be single-channel and 16-bit linearly-encoded.
Returns
Future<CheetahTranscript>: Inferred transcription object.
Throws
CheetahException: If process fails.
Cheetah.flush()
Processes any remaining audio data and returns its transcription.
Returns
Future<CheetahTranscript>: Inferred transcription object.
Throws
CheetahException: If process fails.
Cheetah.delete()
Frees memory that was allocated for Cheetah
Cheetah.frameLength
Getter for the number of audio samples per frame required by Cheetah.
Cheetah.sampleRate
Getter for the audio sample rate required by Cheetah.
Cheetah.version
Getter for Cheetah version string.
CheetahTranscript
Class that contains Cheetah transcript data.
CheetahTranscript.transcript
Getter for transcript data.
CheetahTranscript.isEndpoint
Getter for isEndpoint flag.
CheetahException
Exception thrown if an error occurs within Cheetah: