Call Center SDK  1.11.3
Public Types | Public Member Functions | Static Public Member Functions | List of all members
voicesdk::VoiceVerifyStreamOpus Class Referenceabstract

Class for continuous voice verification using Opus audio stream. More...

#include <voicesdk/verify/verify_stream.h>

Public Types

using Ptr = std::shared_ptr< VoiceVerifyStreamOpus >
 

Public Member Functions

virtual void reset ()=0
 Resets stream state.
 
virtual void addPacket (const uint8_t *bytes, size_t bytesNum)=0
 Adds Opus packet to process. More...
 
virtual void finalize ()=0
 Finalizes input audio stream to process remaining audio samples and produce result if it's possible.
 
virtual bool hasVerifyResults () const =0
 Checks if there are available verification results in output queue. More...
 
virtual VerifyStreamResult getVerifyResult ()=0
 Retrieves verification result from output queue. Use hasVerifyResult() to know if there are available results. More...
 

Static Public Member Functions

static Ptr create (VoiceTemplateFactory::Ptr voiceTemplateFactory, VoiceTemplateMatcher::Ptr voiceTemplateMatcher, VoiceTemplate::Ptr voiceTemplate, size_t sampleRate, size_t audioContextLengthSeconds=10)
 Factory method. More...
 

Detailed Description

Class for continuous voice verification using Opus audio stream.

Member Function Documentation

◆ addPacket()

virtual void voicesdk::VoiceVerifyStreamOpus::addPacket ( const uint8_t *  bytes,
size_t  bytesNum 
)
pure virtual

Adds Opus packet to process.

Parameters
bytesA buffer containing single Opus packet. It is expected that packet contains data for single mono stream
bytesNumNumber of bytes
Exceptions
std::runtime_errorif runtime error occurred
voicesdk::LicenseExceptionif license error occurred
Note
if exception was thrown, then stream state is being reset except the accumulated results buffer

◆ create()

static Ptr voicesdk::VoiceVerifyStreamOpus::create ( VoiceTemplateFactory::Ptr  voiceTemplateFactory,
VoiceTemplateMatcher::Ptr  voiceTemplateMatcher,
VoiceTemplate::Ptr  voiceTemplate,
size_t  sampleRate,
size_t  audioContextLengthSeconds = 10 
)
static

Factory method.

Parameters
voiceTemplateFactoryVoice template factory instance
voiceTemplateMatcherVoice template matcher instance
voiceTemplateReference voice template to match with
sampleRateInput audio stream sampling frequency in Hz. Must be one of 8000, 12000, 16000, 24000 or 48000.
audioContextLengthSecondsLength of audio context for voice verification in seconds, must be at least 3 seconds
Returns
Created VoiceVerifyStream instance
Exceptions
std::runtime_errorif runtime error occurred
voicesdk::LicenseExceptionif license error occurred
Note
Sampling frequency should be equal to or greater than the value returned by VoiceTemplateFactory::getMinimumAudioSampleRate
Voice template matcher, voice template factory and voice template should have the same init data ID

◆ getVerifyResult()

virtual VerifyStreamResult voicesdk::VoiceVerifyStreamOpus::getVerifyResult ( )
pure virtual

Retrieves verification result from output queue. Use hasVerifyResult() to know if there are available results.

Returns
VerifyStreamResult one verification result
Exceptions
std::runtime_errorif runtime error occurred
voicesdk::LicenseExceptionif license error occurred

◆ hasVerifyResults()

virtual bool voicesdk::VoiceVerifyStreamOpus::hasVerifyResults ( ) const
pure virtual

Checks if there are available verification results in output queue.

Returns
true is there are results available, else otherwise.