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
AndroidCiOSPythonWeb
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
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

Cobra Voice Activity Detection
iOS API


API Reference for the Cobra iOS SDK (Cocoapods ).


Cobra

public class Cobra { }

Class for the Cobra VAD engine.

Cobra can be initialized using the class constructor. Resources should be cleaned when you are done using the delete() method.


Cobra.frameLength

public static let frameLength: UInt32

The number of audio samples per frame that Cobra accepts.


Cobra.sampleRate

public static let sampleRate: UInt32

The audio sample rate that Cobra accepts.


Cobra.version

public static let version: String

The Cobra library version string.


Cobra.init()

public init(accessKey: String) throws

init method for Cobra VAD engine.

Parameters

  • access_key String : AccessKey obtained from Picovoice Console .

Returns

  • Cobra : An instance of Cobra VAD engine.

Throws

  • CobraError

Cobra.delete()

public func delete()

Releases resources acquired by Cobra.


Cobra.process()

public func process(pcm: [Int16]) throws -> Float32

Processes a frame of the incoming audio stream and emits the detection result. The required number of samples-per-frame can be obtained by calling .frameLength. The incoming audio needs to have a sample rate equal to .sampleRate and be 16-bit linearly-encoded. Cobra operates on single-channel audio.

Parameters

  • pcm [Int16] : A frame of audio samples.

Returns

  • Float32 : Probability of voice activity. It is a floating-point number within [0, 1].

Throws

  • CobraError

CobraError

public class CobraError : LocalizedError { }

Error thrown if an error occurs within Cobra VAD engine.

Exceptions

public class CobraMemoryError : CobraError {}
public class CobraIOError : CobraError {}
public class CobraInvalidArgumentError : CobraError {}
public class CobraStopIterationError : CobraError {}
public class CobraKeyError : CobraError {}
public class CobraInvalidStateError : CobraError {}
public class CobraRuntimeError : CobraError {}
public class CobraActivationError : CobraError {}
public class CobraActivationLimitError : CobraError {}
public class CobraActivationThrottledError : CobraError {}
public class CobraActivationRefusedError : CobraError {}

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Cobra Voice Activity Detection iOS API
  • Cobra
  • frameLength
  • sampleRate
  • version
  • init()
  • delete()
  • process()
  • CobraError
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.