VoiceSDK  5.0.2
liveness_c_api.h
Go to the documentation of this file.
1 /* Copyright 2023 ID R&D Inc. All Rights Reserved. */
2 
3 #pragma once
4 
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
15 
23 
27 typedef struct VoiceSdkLivenessResult {
32  float score;
33 
38  float probability;
39 
45  VoiceSdkLivenessResultValidationStatusCode status_code;
47 
58  char** error_msg);
59 
73 bool VoiceSdkLivenessEngineCheckLivenessAudioFile(const VoiceSdkLivenessEngine* engine, const char* audio_path,
74  VoiceSdkLivenessResult* result, VoiceSdkErrorCode* error_code,
75  char** error_msg);
76 
93 bool VoiceSdkLivenessEngineCheckLivenessBytes(const VoiceSdkLivenessEngine* engine, const uint8_t* bytes,
94  size_t num_bytes, size_t sample_rate, VoiceSdkLivenessResult* result,
95  VoiceSdkErrorCode* error_code, char** error_msg);
96 
113 bool VoiceSdkLivenessEngineCheckLivenessPcm16Samples(const VoiceSdkLivenessEngine* engine, const int16_t* pcm16_samples,
114  size_t num_samples, size_t sample_rate,
115  VoiceSdkLivenessResult* result, VoiceSdkErrorCode* error_code,
116  char** error_msg);
117 
134 bool VoiceSdkLivenessEngineCheckLivenessFloatSamples(const VoiceSdkLivenessEngine* engine, const float* float_samples,
135  size_t num_samples, size_t sample_rate,
136  VoiceSdkLivenessResult* result, VoiceSdkErrorCode* error_code,
137  char** error_msg);
138 
146 
147 #ifdef __cplusplus
148 }
149 #endif
float probability
Liveness probability from 0 to 1.
Definition: liveness_c_api.h:38
VoiceSdkErrorCode
Enumeration of the error codes which can be returned from the VoiceSDK API.
Definition: core_c_api.h:18
struct VoiceSdkLivenessEngine VoiceSdkLivenessEngine
Voice liveness check structure.
Definition: liveness_c_api.h:14
VOICE_SDK_API bool VoiceSdkLivenessEngineCheckLivenessPcm16Samples(const VoiceSdkLivenessEngine *engine, const int16_t *pcm16_samples, size_t num_samples, size_t sample_rate, VoiceSdkLivenessResult *result, VoiceSdkErrorCode *error_code, char **error_msg)
Checks liveness from the given PCM16 audio samples.
VOICE_SDK_API void VoiceSdkLivenessEngineRelease(VoiceSdkLivenessEngine *engine)
Releases all memory allocated for this VoiceSdkLivenessEngine instance.
Voice liveness check result.
Definition: liveness_c_api.h:27
VOICE_SDK_API VoiceSdkLivenessEngine * VoiceSdkLivenessEngineCreate(const char *init_path, VoiceSdkErrorCode *error_code, char **error_msg)
Creates VoiceSdkLivenessEngine.
VoiceSdkLivenessResultValidationStatusCode
Status code of validation preceding liveness check.
Definition: liveness_c_api.h:19
float score
Raw liveness score.
Definition: liveness_c_api.h:32
VOICE_SDK_API bool VoiceSdkLivenessEngineCheckLivenessAudioFile(const VoiceSdkLivenessEngine *engine, const char *audio_path, VoiceSdkLivenessResult *result, VoiceSdkErrorCode *error_code, char **error_msg)
Checks liveness from the given audio file.
#define VOICE_SDK_API
Definition: config.h:21
VOICE_SDK_API bool VoiceSdkLivenessEngineCheckLivenessFloatSamples(const VoiceSdkLivenessEngine *engine, const float *float_samples, size_t num_samples, size_t sample_rate, VoiceSdkLivenessResult *result, VoiceSdkErrorCode *error_code, char **error_msg)
Checks liveness from the given float audio samples.
Definition: liveness_c_api.h:20
VOICE_SDK_API bool VoiceSdkLivenessEngineCheckLivenessBytes(const VoiceSdkLivenessEngine *engine, const uint8_t *bytes, size_t num_bytes, size_t sample_rate, VoiceSdkLivenessResult *result, VoiceSdkErrorCode *error_code, char **error_msg)
Checks liveness from the given byte representation of PCM16 audio samples.
VoiceSdkLivenessResultValidationStatusCode status_code
Quality check status code. If not equal to kOk, liveness check wasn't performed and score...
Definition: liveness_c_api.h:45
struct VoiceSdkLivenessResult VoiceSdkLivenessResult
Voice liveness check result.