Cobra Voice Activity Detection
iOS API
API Reference for the Cobra iOS SDK (Cocoapods).
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
The number of audio samples per frame that Cobra accepts.
Cobra.sampleRate
The audio sample rate that Cobra accepts.
Cobra.version
The Cobra library version string.
Cobra.init()
init
method for Cobra VAD engine.
Parameters
access_key
String : AccessKey obtained from Picovoice Console.
Returns
Cobra
: An instance of Cobra VAD engine.
Throws
Cobra.delete()
Releases resources acquired by Cobra.
Cobra.process()
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
Error thrown if an error occurs within Cobra
VAD engine.
Exceptions