Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
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()
Voice AI
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.