Cobra Voice Activity Detection
.NET API
API Reference for the Cobra .NET SDK (NuGet).
Cobra
Class for the Cobra VAD engine.
Cobra.Cobra()
Constructor method for the Cobra voice activity detection (VAD) engine.
Parameters
accessKey
str : AccessKey obtained from Picovoice Console.
Returns
Cobra
: An instance of Cobra VAD engine.
Throws
Cobra.FrameLength
The number of audio samples per frame that Cobra accepts.
Cobra.SampleRate
The audio sample rate the Cobra accepts.
Cobra.Version
The Cobra library version string.
Cobra.Dispose()
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
short[] : A frame of audio samples.
Returns
float
: Probability of voice activity. It is a floating-point number within [0, 1].
Throws
CobraException
Error thrown if an error occurs within Cobra
VAD engine.
Exceptions