Picovoice WordmarkPicovoice Console
Introduction
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSNodejsPythonRaspberry PiReact NativeRustWebWindows
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
FAQ
Introduction
AndroidCiOSLinuxmacOSPythonWebWindows
AndroidCiOSPythonWeb
SummaryOctopus Speech-to-IndexGoogle Speech-to-TextMozilla DeepSpeech
FAQ
Introduction
AndroidAngularArduinoBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaMicrocontrollerNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidAngularBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonlinuxmacOSNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidBeagleboneCiOSNvidia JetsonLinuxmacOSPythonRaspberry PiRustWebWindows
AndroidCiOSPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidAngularArduinoBeagleBoneC.NETFlutterlink to GoiOSJavaNvidia JetsonMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustUnityVueWeb
AndroidAngularCMicrocontroller.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
Picovoice SDK - FAQ
IntroductionSTM32F407G-DISC1 (Arm Cortex-M4)STM32F411E-DISCO (Arm Cortex-M4)STM32F769I-DISCO (Arm Cortex-M7)IMXRT1050-EVKB (Arm Cortex-M7)
FAQGlossary

Cheetah Speech-to-Text — Go API


API Reference for the Cheetah Go SDK (pkg.go.dev)


cheetah.FrameLength

var FrameLength int

Number of audio samples per frame.


cheetah.SampleRate

var SampleRate int

Audio sample rate accepted by Cheetah.


cheetah.Version

var Version string

Cheetah version.


cheetah.Cheetah

type Cheetah struct

Struct for the Cheetah Speech-to-Text engine.


cheetah.Cheetah.AccessKey

var AccessKey string

AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).

cheetah.Cheetah.ModelPath

var ModelPath string

Absolute path to the file containing model parameters.

cheetah.Cheetah.LibraryPath

var LibraryPath string

Absolute path to Cheetah's dynamic library.

cheetah.Cheetah.EndpointDuration

var EndpointDuration float32

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

var EnableAutomaticPunctuation bool

Flag to enable automatic punctuation insertion.

cheetah.Cheetah.Delete()

func (cheetah *Cheetah) Delete() error

Releases resources acquired by Cheetah.

Returns

  • error : Error produced by the Cheetah SDK. nil if no error was encountered.

cheetah.Cheetah.Flush()

func (cheetah *Cheetah) Flush() (string, error)

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()

func (cheetah *Cheetah) Init() error

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()

func (cheetah *Cheetah) Process(pcm []int16) (string, bool, error)

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()

func NewCheetah(accessKey string) Cheetah

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

type CheetahError struct

Custom error type for errors produced from the Cheetah Go SDK.


cheetah.CheetahError.Error()

func (e *CheetahError) Error() string

Formats the Cheetah error into a string.

Returns

  • string : Formatted error string.

cheetah.PvStatus

type PvStatus struct

Status return codes from the Cheetah library. Possible values are:

const (
SUCCESS PvStatus = 0
OUT_OF_MEMORY PvStatus = 1
IO_ERROR PvStatus = 2
INVALID_ARGUMENT PvStatus = 3
STOP_ITERATION PvStatus = 4
KEY_ERROR PvStatus = 5
INVALID_STATE PvStatus = 6
RUNTIME_ERROR PvStatus = 7
ACTIVATION_ERROR PvStatus = 8
ACTIVATION_LIMIT_REACHED PvStatus = 9
ACTIVATION_THROTTLED PvStatus = 10
ACTIVATION_REFUSED PvStatus = 11
)

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Cheetah Speech-to-Text — Go API
  • cheetah.FrameLength
  • cheetah.SampleRate
  • cheetah.Version
  • cheetah.Cheetah
  • AccessKey
  • ModelPath
  • LibraryPath
  • EndpointDuration
  • EnableAutomaticPunctuation
  • Delete()
  • Flush()
  • Init()
  • Process()
  • cheetah.NewCheetah()
  • cheetah.CheetahError
  • Error()
  • cheetah.PvStatus
Platform
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Octopus Speech-to-Index
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Resources
  • Docs
  • Console
  • Blog
  • Demos
Sales
  • Pricing
  • Starter Tier
  • Enterprise
Company
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • Twitter
  • Medium
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2022 Picovoice Inc.