Cheetah Speech-to-Text
Go API
API Reference for the Cheetah Go SDK (pkg.go.dev)
cheetah.FrameLength
Number of audio samples per frame.
cheetah.SampleRate
Audio sample rate accepted by Cheetah.
cheetah.Version
Cheetah version.
cheetah.Cheetah
Struct for the Cheetah Speech-to-Text engine.
cheetah.Cheetah.AccessKey
AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
cheetah.Cheetah.ModelPath
Absolute path to the file containing model parameters.
cheetah.Cheetah.LibraryPath
Absolute path to Cheetah's dynamic library.
cheetah.Cheetah.EndpointDuration
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 to 0 to disable endpoint detection.
cheetah.Cheetah.EnableAutomaticPunctuation
Flag to enable automatic punctuation insertion.
cheetah.Cheetah.Delete()
Releases resources acquired by Cheetah.
Returns
error
: Error produced by the Cheetah SDK.nil
if no error was encountered.
cheetah.Cheetah.Flush()
Marks the end of the audio stream, flushes internal state of the object, and returns any remaining transcribed text. Return any remaining transcribed text. If none is available then an empty string is returned.
Returns
string
: Any transcription text.error
: Error produced by the Cheetah SDK.nil
if no error was encountered.
cheetah.Cheetah.Init()
Init function for Cheetah. Must be called before attempting process.
Returns
error
: Error produced by the Cheetah SDK.nil
if no error was encountered.
cheetah.Cheetah.Process()
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.
Returns Any newly-transcribed speech (if none is available then an empty string is returned) and a flag indicating if
an endpoint has been detected.
Returns
string
: Any newly-transcribed speech.bool
: A flag indicating whether an endpoint has been detected.error
: Error produced by the Cheetah SDK.nil
if no error was encountered.
cheetah.NewCheetah()
Creates a Cheetah struct with default parameters.
Parameters
accessKey
string : AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
Returns
Cheetah
: An instance of Cheetah struct.
cheetah.CheetahError
Custom error type for errors produced from the Cheetah Go SDK.
cheetah.CheetahError.Error()
Formats the Cheetah error into a string.
Returns
string
: Formatted error string.
cheetah.PvStatus
Status return codes from the Cheetah library. Possible values are: