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 — iOS API


API Reference for the iOS Cheetah SDK (Cocoapod)


Cheetah

public class Cheetah { }

Class for the Cheetah Speech-to-Text engine. Resources should be cleaned when you are done using the delete() function.


Cheetah.init()

init method for Cheetah Speech-to-Text engine with a mixture of arguments.

public init(
accessKey: String,
modelPath: String,
endpointDuration: Float = 1.0,
enableAutomaticPunctuation: Bool = false) throws -> Cheetah

Parameters

  • accessKey String : The AccessKey obtained from Picovoice Console.
  • modelPath String : Absolute path to file containing model parameters (.pv).
  • endpointDuration Float : 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.
  • enableAutomaticPunctuation Bool : Set to true to enable automatic punctuation insertion.

Throws

  • CheetahError: If an error occurs while creating an instance of Cheetah Speech-to-Text engine.
public init(
accessKey: String,
modelURL: URL,
endpointDuration: Float = 1.0,
enableAutomaticPunctuation: Bool = false) throws -> Cheetah

Parameters

  • accessKey String : The AccessKey obtained from Picovoice Console.
  • modelURL URL : URL to file containing model parameters (.pv).
  • endpointDuration Float : 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.
  • enableAutomaticPunctuation Bool : Set to true to enable automatic punctuation insertion.

Throws

  • CheetahError: If an error occurs while creating an instance of Cheetah Speech-to-Text engine.

Cheetah.delete()

Releases resources acquired by the Cheetah engine.

public func delete()

Cheetah.process()

Process a frame of audio with the Cheetah Speech-to-Text engine.

public func process(pcm:[Int16]) throws -> (String, Bool)

Parameters

  • pcm [Int16] : The number of samples per frame can be attained by calling Cheetah.frameLength. The incoming audio needs to have a sample rate equal to Cheetah.sampleRate and be 16-bit linearly-encoded. Furthermore, Cheetah operates on single-channel audio.

Returns

  • (String, bool) : Tuple of any newly-transcribed speech (if none is available then an empty string is returned) and a flag indicating if an endpoint has been detected.

Throws

  • CheetahError: If there is an error while processing the audio frame.

Cheetah.flush()

Marks the end of the audio stream, flushes internal state of the object, and returns any remaining transcribed text.

public func flush() throws -> String

Returns

  • String : Any remaining transcribed text. If none is available then an empty string is returned.

Throws

  • CheetahError: If there is an error while processing.

Cheetah.frameLength

Cheetah.frameLength: UInt32

The number of audio samples per frame.


Cheetah.sampleRate

Cheetah.sampleRate: UInt32

Audio sample rate accepted by Cheetah.


Cheetah.version

Cheetah.version: String

Current Cheetah version.


CheetahError

public class CheetahError : LocalizedError { }

Error thrown if an error occurs within Cheetah Speech-to-Text engine.

public class CheetahMemoryError : CheetahError {}
public class CheetahIOError : CheetahError {}
public class CheetahInvalidArgumentError : CheetahError {}
public class CheetahStopIterationError : CheetahError {}
public class CheetahKeyError : CheetahError {}
public class CheetahInvalidStateError : CheetahError {}
public class CheetahRuntimeError : CheetahError {}
public class CheetahActivationError : CheetahError {}
public class CheetahActivationLimitError : CheetahError {}
public class CheetahActivationThrottledError : CheetahError {}
public class CheetahActivationRefusedError : CheetahError {}

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Cheetah Speech-to-Text — iOS API
  • Cheetah
  • init()
  • delete()
  • process()
  • flush()
  • frameLength
  • sampleRate
  • version
  • CheetahError
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.