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

Octopus Speech-to-Index
iOS API


API Reference for the Octopus iOS SDK (Cocoapod)


Octopus

public class Octopus { }

Class for the Octopus Speech-to-Index engine.


Octopus.pcmDataSampleRate

Octopus.pcmDataSampleRate: Int

Required audio sample rate for PCM data


Octopus.version

Octopus.version: String

Octopus version


Octopus.init()

public init(accessKey: String, modelPath:String? = nil) throws

Constructor for the Octopus class

Parameters

  • accessKey String : The AccessKey obtained from Picovoice Console.
  • modelPath String? : Absolute path to file containing model parameters (.pv).

Throws

  • OctopusError: If an error occurs while creating an instance of Octopus.

Octopus.delete()

public func delete()

Releases resources acquired by Octopus.


Octopus.indexAudioData()

public func indexAudioData(pcm:[Int16]) throws -> OctopusMetadata

Parameters

  • pcm [Int16] : An array of audio samples. The audio needs to have a sample rate equal to pcmDataSampleRate and be single-channel, 16-bit linearly-encoded.

Returns

  • OctopusMetadata : OctopusMetadata object that is used to perform searches.

Throws

  • OctopusError : If an error occurs while processing the pcm array.

Octopus.indexAudioFile()

public func indexAudioFile(path:String) throws -> OctopusMetadata

Parameters

  • path String : Absolute path to an audio file. Supported formats are: FLAC, MP3, Ogg, Opus, Vorbis, WAV, and WebM.

Returns

  • OctopusMetadata : OctopusMetadata object that is used to perform searches.

Throws

  • OctopusError : If an error occurs while processing the audio file.

Octopus.search()

public func search(metadata: OctopusMetadata, phrases:Set<String>) throws -> Dictionary<String, [OctopusMatch]>

Parameters

  • metadata OctopusMetadata : An OctopusMetadata object obtained via indexAudioData or indexAudioFile.
  • phrases Set<String> : A set of phrases to search for in the metadata.
  • Returns
  • Dictionary<String, [OctopusMatch]> : A dictionary of phrases and match arrays. Matches are represented by immutable OctopusMatch objects.

Throws

  • OctopusError : If an error occurs while processing the searching the metadata.

OctopusError

public enum OctopusError: Error { }

Error type thrown by the Octopus iOS SDK.

case OctopusOutOfMemoryError(_ message:String)
case OctopusIOError(_ message:String)
case OctopusInvalidArgumentError(_ message:String)
case OctopusStopIterationError(_ message:String)
case OctopusKeyError(_ message:String)
case OctopusInvalidStateError(_ message:String)
case OctopusRuntimeError(_ message:String)
case OctopusActivationError(_ message:String)
case OctopusActivationLimitError(_ message:String)
case OctopusActivationThrottledError(_ message:String)
case OctopusActivationRefusedError(_ message:String)
case OctopusInternalError(_ message:String)

OctopusMatch

public struct OctopusMatch { }

The type representing a matched search result.


OctopusMatch.start

OctopusMatch.start: Float

Start time of match in seconds


OctopusMatch.end

OctopusMatch.end: Float

End time of match in seconds


OctopusMatch.probability

OctopusMatch.probability: Float

Probability of the match being correct (floating-point value between [0, 1]).


OctopusMetadata

public class OctopusMetadata { }

The class representing audio indexed by Octopus. Returned by Octopus.indexAudioData or Octopus.indexAudioFile.


OctopusMetadata.init()

public init(metadataBytes:[UInt8])

Constructor.

Parameters

  • metadataBytes [UInt8] : A byte array that was previously obtained via getBytes.

OctopusMetadata.delete()

public func delete()

Releases resources acquired by OctopusMetadata.


OctopusMetadata.getBytes()

public func getBytes() throws -> [UInt8]

Gets a binary representation of the metadata.

Returns

  • [UInt8] : A byte array of the metadata.

Throws

  • OctopusError : If an error occurs while retrieving the metadata bytes.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Octopus Speech-to-Index iOS API
  • Octopus
  • pcmDataSampleRate
  • version
  • init()
  • delete()
  • indexAudioData()
  • indexAudioFile()
  • search()
  • OctopusError
  • OctopusMatch
  • start
  • end
  • probability
  • OctopusMetadata
  • init()
  • delete()
  • getBytes()
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.