VoiceSDK  5.0.2
verify_c_api.h
Go to the documentation of this file.
1 /* Copyright 2021 ID R&D Inc. All Rights Reserved. */
2 
3 #pragma once
4 
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
14 typedef struct VoiceSdkVerifyResult {
18  float score;
19 
23  float probability;
25 
31 
37 
44 
48  size_t size;
50 
55 
63 VoiceSdkVoiceTemplateFactory* VoiceSdkVoiceTemplateFactoryCreate(const char* init_path, char** error_msg);
64 
76  const VoiceSdkVoiceTemplateFactory* factory, const char* wav_path, VoiceSdkChannelType channel_type,
77  char** error_msg);
78 
89  const VoiceSdkVoiceTemplateFactory* factory, const char* audio_path, VoiceSdkChannelType channel_type,
90  char** error_msg);
91 
104  const VoiceSdkVoiceTemplateFactory* factory, const float* float_samples, size_t num_samples, size_t sample_rate,
105  VoiceSdkChannelType channel_type, char** error_msg);
106 
119  const VoiceSdkVoiceTemplateFactory* factory, const int16_t* samples, size_t num_samples, size_t sample_rate,
120  VoiceSdkChannelType channel_type, char** error_msg);
121 
134  const uint8_t* bytes, size_t num_bytes,
135  size_t sample_rate,
136  VoiceSdkChannelType channel_type,
137  char** error_msg);
138 
149  VoiceSdkVoiceTemplate** voice_templates,
150  size_t num_voice_templates, char** error_msg);
151 
159 const char* VoiceSdkVoiceTemplateFactoryGetInitDataId(const VoiceSdkVoiceTemplateFactory* factory, char** error_msg);
160 
170  size_t* sample_rate, char** error_msg);
171 
178 
183 
191 VoiceSdkVoiceTemplateMatcher* VoiceSdkVoiceTemplateMatcherCreate(const char* init_path, char** error_msg);
192 
204  const VoiceSdkVoiceTemplate* template1,
205  const VoiceSdkVoiceTemplate* template2,
206  VoiceSdkVerifyResult* verify_result, char** error_msg);
207 
215 const char* VoiceSdkVoiceTemplateMatcherGetInitDataId(const VoiceSdkVoiceTemplateMatcher* matcher, char** error_msg);
216 
223 
228 
245  const VoiceSdkVoiceTemplateMatcher* matcher,
246  const VoiceSdkVoiceTemplate* const* voice_templates,
247  size_t num_templates, size_t sample_rate,
248  size_t audio_context_length_seconds,
249  float window_length_seconds, char** error_msg);
250 
258 bool VoiceSdkVoiceVerifyStreamReset(const VoiceSdkVoiceVerifyStream* verify_stream, char** error_msg);
259 
270  const float* float_samples, size_t num_samples, char** error_msg);
271 
281 bool VoiceSdkVoiceVerifyStreamAddSamples(const VoiceSdkVoiceVerifyStream* verify_stream, const int16_t* samples,
282  size_t num_samples, char** error_msg);
283 
293 bool VoiceSdkVoiceVerifyStreamAddBytes(const VoiceSdkVoiceVerifyStream* verify_stream, const uint8_t* bytes,
294  size_t num_bytes, char** error_msg);
295 
303 bool VoiceSdkVoiceVerifyStreamFinalize(const VoiceSdkVoiceVerifyStream* verify_stream, char** error_msg);
304 
313 bool VoiceSdkVoiceVerifyStreamHasVerifyResults(const VoiceSdkVoiceVerifyStream* verify_stream, bool* has_results,
314  char** error_msg);
315 
327  VoiceSdkVerifyStreamResultArray* verify_stream_result_array, char** error_msg);
328 
343  VoiceSdkVerifyStreamResult* verify_stream_result,
344  char** error_msg);
345 
352 
357 
371  const VoiceSdkVoiceTemplateMatcher* matcher,
372  const VoiceSdkVoiceTemplate* voice_template,
373  size_t sample_rate,
374  size_t audio_context_length_seconds,
375  char** error_msg);
376 
384 bool VoiceSdkVoiceVerifyStreamOpusReset(const VoiceSdkVoiceVerifyStreamOpus* verify_stream, char** error_msg);
385 
396 bool VoiceSdkVoiceVerifyStreamOpusAddPacket(const VoiceSdkVoiceVerifyStreamOpus* verify_stream, const uint8_t* bytes,
397  size_t num_bytes, char** error_msg);
405 bool VoiceSdkVoiceVerifyStreamOpusFinalize(const VoiceSdkVoiceVerifyStreamOpus* verify_stream, char** error_msg);
406 
416  bool* has_results, char** error_msg);
417 
427  VoiceSdkVerifyStreamResult* verify_stream_result, char** error_msg);
428 
435 
443 
444 #ifdef __cplusplus
445 }
446 #endif
VOICE_SDK_API void VoiceSdkVoiceTemplateFactoryRelease(VoiceSdkVoiceTemplateFactory *factory)
Releases VoiceSdkVoiceTemplateFactory.
VOICE_SDK_API VoiceSdkVoiceTemplateFactory * VoiceSdkVoiceTemplateFactoryCreate(const char *init_path, char **error_msg)
Creates VoiceSdkVoiceTemplateFactory.
VOICE_SDK_API VoiceSdkVoiceVerifyStreamOpus * VoiceSdkVoiceVerifyStreamOpusCreate(const VoiceSdkVoiceTemplateFactory *factory, const VoiceSdkVoiceTemplateMatcher *matcher, const VoiceSdkVoiceTemplate *voice_template, size_t sample_rate, size_t audio_context_length_seconds, char **error_msg)
Creates VoiceSdkVoiceVerifyStreamOpus.
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamGetVerifyResultForOneTemplate(const VoiceSdkVoiceVerifyStream *verify_stream, VoiceSdkVerifyStreamResult *verify_stream_result, char **error_msg)
Retrieves verification result from output queue consisting of single verify stream result correspondi...
VoiceSdkVerifyResult verify_result
Voice verification result.
Definition: verify_c_api.h:30
VoiceSdkAudioInterval audio_interval
Audio interval covered by the verification result.
Definition: verify_c_api.h:35
VoiceSdkChannelType
Definition: core_c_api.h:138
float probability
Voice matching probability from 0 to 1, should be used for making a biometrics authentication decisio...
Definition: verify_c_api.h:23
Voice verification result.
Definition: verify_c_api.h:14
struct VoiceSdkVoiceTemplateMatcher VoiceSdkVoiceTemplateMatcher
Definition: verify_c_api.h:182
struct VoiceSdkVoiceTemplate VoiceSdkVoiceTemplate
Definition: core_c_api.h:47
Definition: verify_c_api.h:38
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamReset(const VoiceSdkVoiceVerifyStream *verify_stream, char **error_msg)
Resets stream's state.
VOICE_SDK_API bool VoiceSdkVoiceTemplateFactoryGetMinimumAudioSampleRate(const VoiceSdkVoiceTemplateFactory *factory, size_t *sample_rate, char **error_msg)
Returns minimum supported input audio sampling frequency in Hz.
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamAddSamples(const VoiceSdkVoiceVerifyStream *verify_stream, const int16_t *samples, size_t num_samples, char **error_msg)
Adds audio samples to process.
Definition: verify_c_api.h:26
VOICE_SDK_API void VoiceSdkVoiceTemplateMatcherRelease(VoiceSdkVoiceTemplateMatcher *matcher)
Releases VoiceSdkVoiceTemplateMatcher.
VOICE_SDK_API const char * VoiceSdkVoiceTemplateFactoryGetInitDataId(const VoiceSdkVoiceTemplateFactory *factory, char **error_msg)
Returns ID of the init data which was used to create the factory.
VoiceSdkVerifyStreamResult * data
Array of voice verification results. Use VoiceSdkVerifyStreamResultArrayDataRelease for deallocation...
Definition: verify_c_api.h:43
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamOpusAddPacket(const VoiceSdkVoiceVerifyStreamOpus *verify_stream, const uint8_t *bytes, size_t num_bytes, char **error_msg)
Adds Opus packet to process.
VOICE_SDK_API VoiceSdkVoiceTemplate * VoiceSdkVoiceTemplateFactoryCreateVoiceTemplateWavFile(const VoiceSdkVoiceTemplateFactory *factory, const char *wav_path, VoiceSdkChannelType channel_type, char **error_msg)
Creates a voice template from the WAV file.
struct VoiceSdkVoiceVerifyStreamOpus VoiceSdkVoiceVerifyStreamOpus
Definition: verify_c_api.h:356
struct VoiceSdkVerifyStreamResult VoiceSdkVerifyStreamResult
VOICE_SDK_API VoiceSdkVoiceTemplateMatcher * VoiceSdkVoiceTemplateMatcherCreate(const char *init_path, char **error_msg)
Creates VoiceSdkVoiceTemplateMatcher.
VOICE_SDK_API VoiceSdkVoiceTemplate * VoiceSdkVoiceTemplateFactoryCreateVoiceTemplateFloatSamples(const VoiceSdkVoiceTemplateFactory *factory, const float *float_samples, size_t num_samples, size_t sample_rate, VoiceSdkChannelType channel_type, char **error_msg)
Creates a voice template from the float audio samples.
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamAddBytes(const VoiceSdkVoiceVerifyStream *verify_stream, const uint8_t *bytes, size_t num_bytes, char **error_msg)
Adds audio samples to process.
struct VoiceSdkVerifyStreamResultArray VoiceSdkVerifyStreamResultArray
VOICE_SDK_API void VoiceSdkVoiceVerifyStreamOpusRelease(VoiceSdkVoiceVerifyStreamOpus *verify_stream)
Releases VoiceSdkVoiceVerifyStreamOpus.
VOICE_SDK_API VoiceSdkVoiceTemplate * VoiceSdkVoiceTemplateFactoryCreateVoiceTemplateSamples(const VoiceSdkVoiceTemplateFactory *factory, const int16_t *samples, size_t num_samples, size_t sample_rate, VoiceSdkChannelType channel_type, char **error_msg)
Creates a voice template from the PCM16 audio samples.
VOICE_SDK_API VoiceSdkVoiceTemplate * VoiceSdkVoiceTemplateFactoryMergeVoiceTemplates(const VoiceSdkVoiceTemplateFactory *factory, VoiceSdkVoiceTemplate **voice_templates, size_t num_voice_templates, char **error_msg)
Merges multiple voice templates of a single speaker to a union voice template.
VOICE_SDK_API VoiceSdkVoiceVerifyStream * VoiceSdkVoiceVerifyStreamCreate(const VoiceSdkVoiceTemplateFactory *factory, const VoiceSdkVoiceTemplateMatcher *matcher, const VoiceSdkVoiceTemplate *const *voice_templates, size_t num_templates, size_t sample_rate, size_t audio_context_length_seconds, float window_length_seconds, char **error_msg)
Creates VoiceSdkVoiceVerifyStream.
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamOpusGetVerifyResult(const VoiceSdkVoiceVerifyStreamOpus *verify_stream, VoiceSdkVerifyStreamResult *verify_stream_result, char **error_msg)
Retrieves verification result from output queue.
size_t size
Number of elements in array.
Definition: verify_c_api.h:48
VOICE_SDK_API const char * VoiceSdkVoiceTemplateMatcherGetInitDataId(const VoiceSdkVoiceTemplateMatcher *matcher, char **error_msg)
Returns ID of the init data which was used to create the matcher.
#define VOICE_SDK_API
Definition: config.h:21
VOICE_SDK_API void VoiceSdkVoiceVerifyStreamRelease(VoiceSdkVoiceVerifyStream *verify_stream)
Releases VoiceSdkVoiceVerifyStream.
VOICE_SDK_API VoiceSdkVoiceTemplate * VoiceSdkVoiceTemplateFactoryCreateVoiceTemplateBytes(const VoiceSdkVoiceTemplateFactory *factory, const uint8_t *bytes, size_t num_bytes, size_t sample_rate, VoiceSdkChannelType channel_type, char **error_msg)
Creates a voice template from the byte representation of PCM16 audio samples.
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamOpusHasVerifyResults(const VoiceSdkVoiceVerifyStreamOpus *verify_stream, bool *has_results, char **error_msg)
Checks if there are available verification results in output queue.
struct VoiceSdkVoiceTemplateFactory VoiceSdkVoiceTemplateFactory
Factory for creating and merging voice templates.
Definition: verify_c_api.h:54
Definition: core_c_api.h:93
struct VoiceSdkVerifyResult VoiceSdkVerifyResult
Voice verification result.
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamGetVerifyResult(const VoiceSdkVoiceVerifyStream *verify_stream, VoiceSdkVerifyStreamResultArray *verify_stream_result_array, char **error_msg)
Retrieves verification result from output queue containing one verify stream result for each referenc...
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamOpusReset(const VoiceSdkVoiceVerifyStreamOpus *verify_stream, char **error_msg)
Resets stream's state.
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamAddFloatSamples(const VoiceSdkVoiceVerifyStream *verify_stream, const float *float_samples, size_t num_samples, char **error_msg)
Adds audio samples to process.
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamOpusFinalize(const VoiceSdkVoiceVerifyStreamOpus *verify_stream, char **error_msg)
Finalizes input audio stream to process remaining audio.
struct VoiceSdkVoiceVerifyStream VoiceSdkVoiceVerifyStream
Definition: verify_c_api.h:227
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamHasVerifyResults(const VoiceSdkVoiceVerifyStream *verify_stream, bool *has_results, char **error_msg)
Checks if there are available verification results in output queue.
VOICE_SDK_API void VoiceSdkVerifyStreamResultArrayDataRelease(const VoiceSdkVerifyStreamResultArray *array)
Releases data array pointer within VoiceSdkVerifyStreamResultArray. Deallocation of array itself shou...
float score
Raw verification score, intended to be used for evaluation and data-wise calibration.
Definition: verify_c_api.h:18
VOICE_SDK_API bool VoiceSdkVoiceVerifyStreamFinalize(const VoiceSdkVoiceVerifyStream *verify_stream, char **error_msg)
Finalizes input audio stream to process remaining audio.
VOICE_SDK_API bool VoiceSdkVoiceTemplateMatcherMatchVoiceTemplates(const VoiceSdkVoiceTemplateMatcher *matcher, const VoiceSdkVoiceTemplate *template1, const VoiceSdkVoiceTemplate *template2, VoiceSdkVerifyResult *verify_result, char **error_msg)
Matches two voice templates one-to-one.
VOICE_SDK_API VoiceSdkVoiceTemplate * VoiceSdkVoiceTemplateFactoryCreateVoiceTemplateAudioFile(const VoiceSdkVoiceTemplateFactory *factory, const char *audio_path, VoiceSdkChannelType channel_type, char **error_msg)
Creates a voice template from the audio file.