Picovoice Wordmark
Start Building
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 GoiOSJavaNVIDIA JetsonLinuxmacOSNodejsPythonRaspberry PiReact NativeRustWebWindows
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
AndroidCiOSNVIDIA JetsonLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSNVIDIA JetsonLinuxmacOSPythonRaspberry PiWebWindows
AndroidCPythoniOSWeb
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)
Introduction
AndroidC.NETFlutterlink to GoiOSNodejsPythonReact NativeRustUnityWeb
AndroidC.NETFlutterlink to GoiOSNodejsPythonReact NativeRustUnityWeb
FAQGlossary

Voice Processor
iOS API

API Reference for the Voice Processor iOS SDK (CocoaPods ).


VoiceProcessor

public class VoiceProcessor { }

The iOS Voice Processor is an asynchronous audio capture library designed for real-time audio processing. Given some specifications, the library delivers frames of raw audio data to the user via listeners.


VoiceProcessor.instance

public static let instance: VoiceProcessor

Singleton instance of VoiceProcessor.


VoiceProcessor.isRecording

public var isRecording: Bool

A boolean value indicating if the VoiceProcessor is currently recording audio.


VoiceProcessor.frameLength

public var frameLength: UInt32?

The number of audio samples per frame. Set when calling the start() method.


VoiceProcessor.sampleRate

public var sampleRate: UInt32?

The sample rate for audio recording, set when calling the start() method.


VoiceProcessor.numFrameListeners

public var numFrameListeners: Int

The number of registered VoiceProcessorFrameListeners.


VoiceProcessor.numErrorListeners

public var numErrorListeners: Int

The number of registered VoiceProcessorErrorListeners.


VoiceProcessor.hasRecordAudioPermission

public static var hasRecordAudioPermission: Bool

Indicates whether the app has permission to record audio.

Returns

  • Bool: True if the app has permission to record audio, false otherwise.

VoiceProcessor.requestRecordAudioPermission()

public static func requestRecordAudioPermission(_ response: @escaping (Bool) -> Void)

Requests permission to record audio from the user.

Parameters

  • response @escaping (Bool) -> Void : A closure to handle the user's response to the permission request.

VoiceProcessor.addFrameListener()

public func addFrameListener(_ listener: VoiceProcessorFrameListener)

Adds a listener to receive audio frames.

Parameters

  • listener VoiceProcessorFrameListener: The VoiceProcessorFrameListener to be added as a frame listener.

VoiceProcessor.addFrameListeners()

public func addFrameListeners(_ listeners: [VoiceProcessorFrameListener])

Adds multiple frame listeners to receive audio frames.

Parameters

  • listeners [VoiceProcessorFrameListener] : An array of VoiceProcessorFrameListener to be added as frame listeners.

VoiceProcessor.removeFrameListener()

public func removeFrameListener(_ listener: VoiceProcessorFrameListener)

Removes a previously added frame listener.

Parameters

  • listener VoiceProcessorFrameListener : The VoiceProcessorFrameListener to be removed.

VoiceProcessor.removeFrameListeners()

public func removeFrameListeners(_ listeners: [VoiceProcessorFrameListener])

Removes previously added multiple frame listeners.

Parameters

  • listeners [VoiceProcessorFrameListener] : An array of VoiceProcessorFrameListener to be removed.

VoiceProcessor.clearFrameListeners()

public func clearFrameListeners()

Clears all currently registered frame listeners.


VoiceProcessor.addErrorListener()

public func addErrorListener(_ listener: VoiceProcessorErrorListener)

Adds an error listener.

Parameters

  • listener VoiceProcessorErrorListener : The VoiceProcessorErrorListener to be added as an error listener.

VoiceProcessor.removeErrorListener()

public func removeErrorListener(_ listener: VoiceProcessorErrorListener)

Removes a previously added error listener.

Parameters

  • listener VoiceProcessorErrorListener : The VoiceProcessorErrorListener to be removed.

VoiceProcessor.clearErrorListeners()

public func clearErrorListeners()

Clears all error listeners.


VoiceProcessor.start()

public func start(frameLength: UInt32, sampleRate: UInt32) throws

Starts audio recording with the specified audio properties.

Parameters

  • frameLength UInt32 : The length of each audio frame, in number of samples.
  • sampleRate UInt32 : The sample rate to record audio at, in Hz.

Throws

  • VoiceProcessorError : An error if there is an issue starting the audio recording.

VoiceProcessor.stop()

public func stop() throws

Stops audio recording and releases audio resources.

Throws

  • VoiceProcessorError: An error if there is an issue stopping the audio recording.

VoiceProcessorError

public class VoiceProcessorError: LocalizedError { }

Error thrown if an error occurs within the VoiceProcessor.

public class VoiceProcessorArgumentError : VoiceProcessorError {}
public class VoiceProcessorReadError : VoiceProcessorError {}
public class VoiceProcessorRuntimeError : VoiceProcessorError {}

VoiceProcessorErrorCallback

public typealias VoiceProcessorErrorCallback = (VoiceProcessorError) -> Void

Typealias for the callback function that handles errors that are emitted from VoiceProcessor.


VoiceProcessorErrorListener

public class VoiceProcessorErrorListener { }

Listener class for receiving errors from VoiceProcessor.


VoiceProcessorErrorListener.init()

public init(_ callback: @escaping VoiceProcessorErrorCallback)

Initializes a new VoiceProcessorErrorListener.

Parameters

  • callback @escaping VoiceProcessorErrorCallback : The callback function to be called when a VoiceProcessorError occurs.

VoiceProcessorErrorListener.onError()

public func onError(_ error: VoiceProcessorError)

Function called when a VoiceProcessorError occurs.

Parameters

  • error VoiceProcessorError : Error.

VoiceProcessorFrameCallback

public typealias VoiceProcessorFrameCallback = ([Int16]) -> Void

Typealias for the callback function that handles frames of audio data.


VoiceProcessorFrameListener

public class VoiceProcessorFrameListener { }

Listener class for receiving audio frames from VoiceProcessor.


VoiceProcessorFrameListener.init()

public init(_ callback: @escaping VoiceProcessorFrameCallback)

Initializes a new VoiceProcessorFrameListener.

Parameters

  • callback @escaping VoiceProcessorFrameCallback : The callback function to be called when an audio frame is received.

VoiceProcessorFrameListener.onFrame()

public func onFrame(_ frame: [Int16])

Function called when a frame of audio is received.

Parameters

  • frame [Int16] : Frame of audio.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Voice Processor iOS API
  • VoiceProcessor
  • instance
  • isRecording
  • frameLength
  • sampleRate
  • numFrameListeners
  • numErrorListeners
  • hasRecordAudioPermission
  • requestRecordAudioPermission()
  • addFrameListener()
  • addFrameListeners()
  • removeFrameListener()
  • removeFrameListeners()
  • clearFrameListeners()
  • addErrorListener()
  • removeErrorListener()
  • clearErrorListeners()
  • start()
  • stop()
  • VoiceProcessorError
  • VoiceProcessorErrorCallback
  • VoiceProcessorErrorListener
  • init()
  • onError()
  • VoiceProcessorFrameCallback
  • VoiceProcessorFrameListener
  • init()
  • onFrame()
Platform
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Koala Noise Suppression
  • Eagle Speaker RecognitionBETA
  • Octopus Speech-to-Index
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
  • Orca Text-to-SpeechWAITLIST
  • Falcon Speaker DiarizationWAITLIST
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
Sales & Services
  • Consulting
  • Developer Plan
  • Enterprise Plan
  • Support Add-on
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • Twitter
  • Medium
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2022 Picovoice Inc.