VoiceVerifyStream

Superclass:
NSObject
Declared In:

Introduction

Class for continuous voice verification using audio stream.



Methods

-addSamples:error:

Adds PCM16 audio samples to process.

-finalizeStream:

Finalizes input audio stream to process remaining audio samples and produce result if it's possible.

-getVerifyResult:

Retrieves verification result from output queue containing one verify stream result for each reference template. Use hasVerifyResult() to know if there are available results

-getVerifyResultForOneTemplate:

Retrieves verification result from output queue consisting of single verify stream result corresponding to the zeroth reference template. Suitable for the case when the only one reference template was specified. Use hasVerifyResult() to know if there are available results

-hasVerifyResults:

Checks if there are available verification results in output queue.

-initWithVoiceTemplateFactory:voiceTemplateMatcher:voiceTemplates:sampleRate:audioContextLengthSeconds:error:

Voice verify stream constructor.

-initWithVoiceTemplateFactory:voiceTemplateMatcher:voiceTemplates:sampleRate:audioContextLengthSeconds:windowLengthSeconds:error:

Voice verify stream constructor.

-initWithVoiceTemplateFactory:voiceTemplateMatcher:voiceTemplates:sampleRate:error:

Voice verify stream constructor.

-reset:

Method for resetting stream state.


addSamples:error:


Adds PCM16 audio samples to process.

- (BOOL)addSamples:(NSData* _Nonnull)PCM16Samples error:(NSError* _Nullable* _Nullable)error; 
Parameters
PCM16Samples

audio samples in PCM16 format

error

pointer to NSError for error reporting

Return Value

True on success, false otherwise.

If error has happened stream state is being reset except the accumulated results buffer.:


finalizeStream:


Finalizes input audio stream to process remaining audio samples and produce result if it's possible.

- (BOOL)finalizeStream:(NSError* _Nullable* _Nullable)error; 
Parameters
error

pointer to NSError for error reporting

Return Value

True on success, false otherwise.


getVerifyResult:


Retrieves verification result from output queue containing one verify stream result for each reference template. Use hasVerifyResult() to know if there are available results

- (NSArray* _Nullable)getVerifyResult:(NSError* _Nullable* _Nullable)error; 
Parameters
error

pointer to NSError for error reporting

Return Value

One verification result.

This method will produce an error if the output results queue is empty.:


getVerifyResultForOneTemplate:


Retrieves verification result from output queue consisting of single verify stream result corresponding to the zeroth reference template. Suitable for the case when the only one reference template was specified. Use hasVerifyResult() to know if there are available results

- (VerifyStreamResult* _Nullable)
        getVerifyResultForOneTemplate:(NSError* _Nullable* _Nullable)error; 
Parameters
error

pointer to NSError for error reporting

Return Value

One verification result for the zeroth reference template.

This method will produce an error if the output results queue is empty.:

Behaves the same as getVerifyResult in IDVoice < 3.13, if only one reference template was set


hasVerifyResults:


Checks if there are available verification results in output queue.

- (VoiceSdkBool* _Nullable)hasVerifyResults:(NSError* _Nullable* _Nullable)error; 
Parameters
error

pointer to NSError for error reporting

Return Value

Boolean flag (true is there are results available, else otherwise).


initWithVoiceTemplateFactory:voiceTemplateMatcher:voiceTemplates:sampleRate:audioContextLengthSeconds:error:


Voice verify stream constructor.

- (instancetype _Nullable)initWithVoiceTemplateFactory:(VoiceTemplateFactory* _Nonnull)voiceTemplateFactory 
        voiceTemplateMatcher:(VoiceTemplateMatcher* _Nonnull)voiceTemplateMatcher 
        voiceTemplates:(NSArray* _Nonnull)voiceTemplates sampleRate:(size_t)sampleRate 
        audioContextLengthSeconds:(size_t)audioContextLengthSeconds 
        error:(NSError* _Nullable* _Nullable)error; 
Parameters
voiceTemplateFactory

Voice template factory instance

voiceTemplateMatcher

Voice template matcher instance

voiceTemplates

Reference voice templates to match with

sampleRate

Input audio stream sampling frequency in Hz

audioContextLengthSeconds

Length of audio context for voice verification in seconds, must be at least 3 seconds

error

pointer to NSError for error reporting

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.:


initWithVoiceTemplateFactory:voiceTemplateMatcher:voiceTemplates:sampleRate:audioContextLengthSeconds:windowLengthSeconds:error:


Voice verify stream constructor.

- (instancetype _Nullable)initWithVoiceTemplateFactory:(VoiceTemplateFactory* _Nonnull)voiceTemplateFactory 
        voiceTemplateMatcher:(VoiceTemplateMatcher* _Nonnull)voiceTemplateMatcher 
        voiceTemplates:(NSArray* _Nonnull)voiceTemplates sampleRate:(size_t)sampleRate 
        audioContextLengthSeconds:(size_t)audioContextLengthSeconds 
        windowLengthSeconds:(float)windowLengthSeconds error:(NSError* _Nullable* _Nullable)error; 
Parameters
voiceTemplateFactory

Voice template factory instance

voiceTemplateMatcher

Voice template matcher instance

voiceTemplates

Reference voice templates to match with

sampleRate

Input audio stream sampling frequency in Hz

audioContextLengthSeconds

Length of audio context for voice verification in seconds, must be at least windowLengthSeconds

windowLengthSeconds

Length of audio window passed to the template creation during stream processing, must be at least 0.5 seconds

error

pointer to NSError for error reporting

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.:


initWithVoiceTemplateFactory:voiceTemplateMatcher:voiceTemplates:sampleRate:error:


Voice verify stream constructor.

- (instancetype _Nullable)initWithVoiceTemplateFactory:(VoiceTemplateFactory* _Nonnull)voiceTemplateFactory 
        voiceTemplateMatcher:(VoiceTemplateMatcher* _Nonnull)voiceTemplateMatcher 
        voiceTemplates:(NSArray* _Nonnull)voiceTemplates sampleRate:(size_t)sampleRate 
        error:(NSError* _Nullable* _Nullable)error; 
Parameters
voiceTemplateFactory

Voice template factory instance

voiceTemplateMatcher

Voice template matcher instance

voiceTemplates

Reference voice templates to match with

sampleRate

Input audio stream sampling frequency in Hz

error

pointer to NSError for error reporting

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.:


reset:


Method for resetting stream state.

- (BOOL)reset:(NSError* _Nullable* _Nullable)error; 
Parameters
error

pointer to NSError for error reporting

Return Value

True on success, false otherwise.