VoiceSDK
5.0.2
|
Go to the source code of this file.
Classes | |
struct | VoiceSdkBuildInfo |
struct | VoiceSdkLicenseFeatureInfo |
DocSDK feature information. More... | |
struct | VoiceSdkLicenseExpirationDate |
struct | VoiceSdkAudioInterval |
struct | VoiceSdkAudioInfo |
Macros | |
#define | DECL_TYPED_ARRAY(name, type) |
Typedefs | |
typedef enum VoiceSdkErrorCode | VoiceSdkErrorCode |
Enumeration of the error codes which can be returned from the VoiceSDK API. More... | |
typedef struct VoiceSdkVoiceTemplate | VoiceSdkVoiceTemplate |
typedef struct VoiceSdkBuildInfo | VoiceSdkBuildInfo |
typedef enum VoiceSdkLicenseFeature | VoiceSdkLicenseFeature |
VoiceSDK licensed features. More... | |
typedef struct VoiceSdkLicenseFeatureInfo | VoiceSdkLicenseFeatureInfo |
DocSDK feature information. More... | |
typedef struct VoiceSdkLicenseExpirationDate | VoiceSdkLicenseExpirationDate |
typedef struct VoiceSdkAudioInterval | VoiceSdkAudioInterval |
typedef struct VoiceSdkAudioInfo | VoiceSdkAudioInfo |
typedef enum VoiceSdkChannelType | VoiceSdkChannelType |
Enumerations | |
enum | VoiceSdkErrorCode { kVoiceSdkErrorCodeOk = 0, kVoiceSdkErrorCodeNullPointer = 1, kVoiceSdkErrorCodeInvalidArgument = 2, kVoiceSdkErrorCodeRuntimeError = 3, kVoiceSdkErrorCodeLicenseError = 4 } |
Enumeration of the error codes which can be returned from the VoiceSDK API. More... | |
enum | VoiceSdkLicenseFeature { kVoiceSdkLicenseFeatureCore = 7, kVoiceSdkLicenseFeatureVerification = 2, kVoiceSdkLicenseFeatureLivenessPresentationAttackDetection, kVoiceSdkLicenseFeatureLivenessVoiceClonesDetection = 31, kVoiceSdkLicenseFeatureQualityChecking = 6 } |
VoiceSDK licensed features. More... | |
enum | VoiceSdkChannelType { CHANNEL_TYPE_MIC = 1, CHANNEL_TYPE_TEL = 2, CHANNEL_TYPE_MIXED = 3 } |
Functions | |
VOICE_SDK_API void | VoiceSdkGetBuildInfo (VoiceSdkBuildInfo *build_info) |
Returns present VoiceSDK build info. More... | |
VOICE_SDK_API void | VoiceSdkSetNumThreads (unsigned int num_threads) |
Sets the maximum number of threads available for VoiceSDK. More... | |
VOICE_SDK_API void | VoiceSdkSetAllowMobileGpu (bool allow_mobile_gpu) |
Sets whether GPU delegate allowed to be used for VoiceSDK (for Android devices only). More... | |
VOICE_SDK_API void | VoiceSdkSetAllowMobileNnapi (bool allow_mobile_nnapi) |
Sets whether NNAPI delegate allowed to be used for VoiceSDK (for Android devices only). More... | |
VOICE_SDK_API void | VoiceSdkSetUseVoiceTemplateCompression (bool use_voice_template_compression) |
Sets whether to compress voice templates serialization.. Voice template compression is not used by default. More... | |
VOICE_SDK_API bool | VoiceSdkSetMobileLicense (const char *mobile_license_string, char **error_msg) |
Sets the mobile SDK license (only can be used for Android and iOS SDKs). More... | |
VOICE_SDK_API VoiceSdkLicenseFeatureInfo * | VoiceSdkGetLicenseInfo (size_t *num_license_features, VoiceSdkErrorCode *error_code, char **error_msg) |
Returns information (enabled features and expiration dates) about the installed license if available. More... | |
VOICE_SDK_API void | VoiceSdkLicenseFeatureInfoArrayRelease (VoiceSdkLicenseFeatureInfo *license_info) |
Releases VoiceSdkLicenseFeatureInfo array. More... | |
VOICE_SDK_API VoiceSdkLicenseExpirationDate | VoiceSdkGetLicenseExpirationDate () |
Returns license expiration date in YYYY-MM-DD format. The returned date corresponds to the SDK feature that expires first. More... | |
VOICE_SDK_API VoiceSdkByteArray * | VoiceSdkWavUtilsReadFromFileAsPcm16Bytes (const char *wav_path, size_t *sample_rate, char **error_msg) |
Reads WAV file as a PCM16 bytes buffer (WAV file can be of any format) More... | |
VOICE_SDK_API VoiceSdkShortArray * | VoiceSdkWavUtilsReadFromFileAsPcm16Samples (const char *wav_path, size_t *sample_rate, char **error_msg) |
Reads WAV file as a PCM16 samples buffer (WAV file can be of any format) More... | |
VOICE_SDK_API VoiceSdkFloatArray * | VoiceSdkWavUtilsReadFromFileAsFloatSamples (const char *wav_path, size_t *sample_rate, char **error_msg) |
Reads WAV file as a float samples buffer (WAV file can be of any format) More... | |
VOICE_SDK_API VoiceSdkFloatArray * | VoiceSdkWavUtilsReadFromFileAs16BitFloatSamples (const char *wav_path, size_t *sample_rate, char **error_msg) |
Reads WAV file as a float samples buffer with 16-bit precision (WAV file can be of any format) More... | |
VOICE_SDK_API VoiceSdkByteArray * | VoiceSdkWavUtilsReadFromBufferAsPcm16Bytes (const uint8_t *data, size_t data_size, size_t *sample_rate, char **error_msg) |
Reads WAV file from a memory buffer as a PCM16 bytes buffer (WAV file can be of any format) More... | |
VOICE_SDK_API VoiceSdkShortArray * | VoiceSdkWavUtilsReadFromBufferAsPcm16Samples (const uint8_t *data, size_t data_size, size_t *sample_rate, char **error_msg) |
Reads WAV file from a memory buffer as a PCM16 samples buffer (WAV file can be of any format) More... | |
VOICE_SDK_API VoiceSdkFloatArray * | VoiceSdkWavUtilsReadFromBufferAsFloatSamples (const uint8_t *data, size_t data_size, size_t *sample_rate, char **error_msg) |
Reads WAV file from a memory buffer as a float samples buffer (WAV file can be of any format) More... | |
VOICE_SDK_API VoiceSdkFloatArray * | VoiceSdkWavUtilsReadFromBufferAs16BitFloatSamples (const uint8_t *data, size_t data_size, size_t *sample_rate, char **error_msg) |
Reads WAV file from a memory buffer as a float samples buffer with 16-bit precision (WAV file can be of any format) More... | |
VOICE_SDK_API bool | VoiceSdkWavUtilsGetAudioInfoFromFile (const char *wav_path, VoiceSdkAudioInfo *result, char **error_msg) |
Returns WAV file audio info. More... | |
VOICE_SDK_API bool | VoiceSdkWavUtilsGetAudioInfoFromBuffer (const uint8_t *data, size_t data_size, VoiceSdkAudioInfo *result, char **error_msg) |
Returns WAV file audio info. More... | |
VOICE_SDK_API VoiceSdkVoiceTemplate * | VoiceSdkVoiceTemplateLoadFromFile (const char *filepath, char **error_msg) |
Loads voice template from the file. More... | |
VOICE_SDK_API bool | VoiceSdkVoiceTemplateSaveToFile (const VoiceSdkVoiceTemplate *voice_template, const char *filepath, char **error_msg) |
Saves voice template to the file. More... | |
VOICE_SDK_API VoiceSdkVoiceTemplate * | VoiceSdkVoiceTemplateDeserialize (const uint8_t *array, size_t array_size, char **error_msg) |
Deserializes voice template from the array. More... | |
VOICE_SDK_API VoiceSdkByteArray * | VoiceSdkVoiceTemplateSerialize (const VoiceSdkVoiceTemplate *voice_template, char **error_msg) |
Serializes voice template to the array. More... | |
VOICE_SDK_API bool | VoiceSdkVoiceTemplateGetChannelType (const VoiceSdkVoiceTemplate *voice_template, VoiceSdkChannelType *channel_type, char **error_msg) |
Retrieves voice template channel type which was specified by user on creation. More... | |
VOICE_SDK_API const char * | VoiceSdkVoiceTemplateGetInitDataId (const VoiceSdkVoiceTemplate *voice_template, char **error_msg) |
Returns ID of the init data, which was used to create the template. More... | |
VOICE_SDK_API bool | VoiceSdkVoiceTemplateIsValid (const VoiceSdkVoiceTemplate *voice_template, bool *is_valid, char **error_msg) |
Checks if voice template is valid or not. More... | |
VOICE_SDK_API void | VoiceSdkVoiceTemplateRelease (VoiceSdkVoiceTemplate *voice_template) |
Releases VoiceSdkVoiceTemplate. More... | |
VOICE_SDK_API VoiceSdkShortArray * | VoiceSdkOpusUtilsReadFromBufferAsPcm16Samples (const uint8_t *data, size_t data_size, size_t *sample_rate, char **error_msg) |
Reads Opus file from a memory buffer and decodes it to PCM16 samples buffer. More... | |
#define DECL_TYPED_ARRAY | ( | name, | |
type | |||
) |
typedef struct VoiceSdkAudioInfo VoiceSdkAudioInfo |
typedef struct VoiceSdkAudioInterval VoiceSdkAudioInterval |
typedef struct VoiceSdkBuildInfo VoiceSdkBuildInfo |
typedef enum VoiceSdkChannelType VoiceSdkChannelType |
typedef enum VoiceSdkErrorCode VoiceSdkErrorCode |
Enumeration of the error codes which can be returned from the VoiceSDK API.
typedef struct VoiceSdkLicenseExpirationDate VoiceSdkLicenseExpirationDate |
typedef enum VoiceSdkLicenseFeature VoiceSdkLicenseFeature |
VoiceSDK licensed features.
typedef struct VoiceSdkLicenseFeatureInfo VoiceSdkLicenseFeatureInfo |
DocSDK feature information.
typedef struct VoiceSdkVoiceTemplate VoiceSdkVoiceTemplate |
enum VoiceSdkChannelType |
enum VoiceSdkErrorCode |
Enumeration of the error codes which can be returned from the VoiceSDK API.
VoiceSDK licensed features.
VOICE_SDK_API void VoiceSdkGetBuildInfo | ( | VoiceSdkBuildInfo * | build_info | ) |
Returns present VoiceSDK build info.
[out] | build_info | Build info to fill, pointer to preallocated structure instance. You do not need to free the nested strings. |
VOICE_SDK_API VoiceSdkLicenseExpirationDate VoiceSdkGetLicenseExpirationDate | ( | ) |
Returns license expiration date in YYYY-MM-DD format. The returned date corresponds to the SDK feature that expires first.
VOICE_SDK_API VoiceSdkLicenseFeatureInfo* VoiceSdkGetLicenseInfo | ( | size_t * | num_license_features, |
VoiceSdkErrorCode * | error_code, | ||
char ** | error_msg | ||
) |
Returns information (enabled features and expiration dates) about the installed license if available.
[out] | num_license_features | number of enabled VoiceSDK features. |
[out] | error_code | pointer to the error code. |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API void VoiceSdkLicenseFeatureInfoArrayRelease | ( | VoiceSdkLicenseFeatureInfo * | license_info | ) |
Releases VoiceSdkLicenseFeatureInfo array.
[in] | license_info | pointer to arrays of VoiceSdkLicenseFeatureInfo |
VOICE_SDK_API VoiceSdkShortArray* VoiceSdkOpusUtilsReadFromBufferAsPcm16Samples | ( | const uint8_t * | data, |
size_t | data_size, | ||
size_t * | sample_rate, | ||
char ** | error_msg | ||
) |
Reads Opus file from a memory buffer and decodes it to PCM16 samples buffer.
[in] | data | memory buffer containing complete Opus file contents |
[in] | data_size | memory buffer length |
[out] | sample_rate | returns sample rate of Opus file |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API void VoiceSdkSetAllowMobileGpu | ( | bool | allow_mobile_gpu | ) |
Sets whether GPU delegate allowed to be used for VoiceSDK (for Android devices only).
[in] | allow_mobile_gpu | whether GPU is allowed to be used for VoiceSDK execution. |
VOICE_SDK_API void VoiceSdkSetAllowMobileNnapi | ( | bool | allow_mobile_nnapi | ) |
Sets whether NNAPI delegate allowed to be used for VoiceSDK (for Android devices only).
[in] | allow_mobile_nnapi | whether NNAPI is allowed to be used for VoiceSDK execution. |
VOICE_SDK_API bool VoiceSdkSetMobileLicense | ( | const char * | mobile_license_string, |
char ** | error_msg | ||
) |
Sets the mobile SDK license (only can be used for Android and iOS SDKs).
[in] | mobile_license_string | mobile SDK license string. |
[out] | error_msg | output error message |
true | if the invocation was successful, false in case of any errors |
VOICE_SDK_API void VoiceSdkSetNumThreads | ( | unsigned int | num_threads | ) |
Sets the maximum number of threads available for VoiceSDK.
If 0 passed, then the optimal number of threads is detected automatically (the same effect is achieved if setNumThreads is not called).
[in] | num_threads | maximum number of threads available for VoiceSDK. |
VOICE_SDK_API void VoiceSdkSetUseVoiceTemplateCompression | ( | bool | use_voice_template_compression | ) |
Sets whether to compress voice templates serialization.. Voice template compression is not used by default.
[in] | use_voice_template_compression | whether to compress voice templates serialization. |
VOICE_SDK_API VoiceSdkVoiceTemplate* VoiceSdkVoiceTemplateDeserialize | ( | const uint8_t * | array, |
size_t | array_size, | ||
char ** | error_msg | ||
) |
Deserializes voice template from the array.
[in] | array | serialized template |
[in] | array_size | size of serialized template |
[out] | error_msg | output error message |
VOICE_SDK_API bool VoiceSdkVoiceTemplateGetChannelType | ( | const VoiceSdkVoiceTemplate * | voice_template, |
VoiceSdkChannelType * | channel_type, | ||
char ** | error_msg | ||
) |
Retrieves voice template channel type which was specified by user on creation.
[in] | voice_template | pointer to VoiceSdkVoiceTemplate |
[out] | channel_type | pointer to VoiceSdkChannelType |
[out] | error_msg | output error message |
true | if the invocation was successful, false in case of any errors |
VOICE_SDK_API const char* VoiceSdkVoiceTemplateGetInitDataId | ( | const VoiceSdkVoiceTemplate * | voice_template, |
char ** | error_msg | ||
) |
Returns ID of the init data, which was used to create the template.
[in] | voice_template | pointer to VoiceSdkVoiceTemplate |
[out] | error_msg | output error message |
VOICE_SDK_API bool VoiceSdkVoiceTemplateIsValid | ( | const VoiceSdkVoiceTemplate * | voice_template, |
bool * | is_valid, | ||
char ** | error_msg | ||
) |
Checks if voice template is valid or not.
[in] | voice_template | pointer to VoiceSdkVoiceTemplate |
[out] | is_valid | true if voice template is valid, false otherwise |
[out] | error_msg | output error message |
true | if the invocation was successful, false in case of any errors |
VOICE_SDK_API VoiceSdkVoiceTemplate* VoiceSdkVoiceTemplateLoadFromFile | ( | const char * | filepath, |
char ** | error_msg | ||
) |
Loads voice template from the file.
[in] | filepath | path to the input file |
[out] | error_msg | output error message |
VOICE_SDK_API void VoiceSdkVoiceTemplateRelease | ( | VoiceSdkVoiceTemplate * | voice_template | ) |
Releases VoiceSdkVoiceTemplate.
[in] | voice_template | pointer to VoiceSdkVoiceTemplate |
VOICE_SDK_API bool VoiceSdkVoiceTemplateSaveToFile | ( | const VoiceSdkVoiceTemplate * | voice_template, |
const char * | filepath, | ||
char ** | error_msg | ||
) |
Saves voice template to the file.
[in] | voice_template | pointer to VoiceSdkVoiceTemplate |
[in] | filepath | path to the output file |
[out] | error_msg | output error message |
true | if the invocation was successful, false in case of any errors |
VOICE_SDK_API VoiceSdkByteArray* VoiceSdkVoiceTemplateSerialize | ( | const VoiceSdkVoiceTemplate * | voice_template, |
char ** | error_msg | ||
) |
Serializes voice template to the array.
[in] | voice_template | pointer to VoiceSdkVoiceTemplate |
[out] | error_msg | output error message |
VOICE_SDK_API bool VoiceSdkWavUtilsGetAudioInfoFromBuffer | ( | const uint8_t * | data, |
size_t | data_size, | ||
VoiceSdkAudioInfo * | result, | ||
char ** | error_msg | ||
) |
Returns WAV file audio info.
[in] | data | memory buffer containing complete WAV file contents |
[in] | data_size | memory buffer length |
[out] | result | result of the call, pointer to preallocated structure instance |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API bool VoiceSdkWavUtilsGetAudioInfoFromFile | ( | const char * | wav_path, |
VoiceSdkAudioInfo * | result, | ||
char ** | error_msg | ||
) |
Returns WAV file audio info.
[in] | wav_path | path to WAV file |
[out] | result | result of the call, pointer to preallocated structure instance |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API VoiceSdkFloatArray* VoiceSdkWavUtilsReadFromBufferAs16BitFloatSamples | ( | const uint8_t * | data, |
size_t | data_size, | ||
size_t * | sample_rate, | ||
char ** | error_msg | ||
) |
Reads WAV file from a memory buffer as a float samples buffer with 16-bit precision (WAV file can be of any format)
[in] | data | memory buffer containing complete WAV file contents |
[in] | data_size | memory buffer length |
[out] | sample_rate | returns sample rate of WAV file |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API VoiceSdkFloatArray* VoiceSdkWavUtilsReadFromBufferAsFloatSamples | ( | const uint8_t * | data, |
size_t | data_size, | ||
size_t * | sample_rate, | ||
char ** | error_msg | ||
) |
Reads WAV file from a memory buffer as a float samples buffer (WAV file can be of any format)
[in] | data | memory buffer containing complete WAV file contents |
[in] | data_size | memory buffer length |
[out] | sample_rate | returns sample rate of WAV file |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API VoiceSdkByteArray* VoiceSdkWavUtilsReadFromBufferAsPcm16Bytes | ( | const uint8_t * | data, |
size_t | data_size, | ||
size_t * | sample_rate, | ||
char ** | error_msg | ||
) |
Reads WAV file from a memory buffer as a PCM16 bytes buffer (WAV file can be of any format)
[in] | data | memory buffer containing complete WAV file contents |
[in] | data_size | memory buffer length |
[out] | sample_rate | returns sample rate of WAV file |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API VoiceSdkShortArray* VoiceSdkWavUtilsReadFromBufferAsPcm16Samples | ( | const uint8_t * | data, |
size_t | data_size, | ||
size_t * | sample_rate, | ||
char ** | error_msg | ||
) |
Reads WAV file from a memory buffer as a PCM16 samples buffer (WAV file can be of any format)
[in] | data | memory buffer containing complete WAV file contents |
[in] | data_size | memory buffer length |
[out] | sample_rate | returns sample rate of WAV file |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API VoiceSdkFloatArray* VoiceSdkWavUtilsReadFromFileAs16BitFloatSamples | ( | const char * | wav_path, |
size_t * | sample_rate, | ||
char ** | error_msg | ||
) |
Reads WAV file as a float samples buffer with 16-bit precision (WAV file can be of any format)
[in] | wav_path | path to WAV file |
[out] | sample_rate | returns sample rate of WAV file |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API VoiceSdkFloatArray* VoiceSdkWavUtilsReadFromFileAsFloatSamples | ( | const char * | wav_path, |
size_t * | sample_rate, | ||
char ** | error_msg | ||
) |
Reads WAV file as a float samples buffer (WAV file can be of any format)
[in] | wav_path | path to WAV file |
[out] | sample_rate | returns sample rate of WAV file |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API VoiceSdkByteArray* VoiceSdkWavUtilsReadFromFileAsPcm16Bytes | ( | const char * | wav_path, |
size_t * | sample_rate, | ||
char ** | error_msg | ||
) |
Reads WAV file as a PCM16 bytes buffer (WAV file can be of any format)
[in] | wav_path | path to WAV file |
[out] | sample_rate | returns sample rate of WAV file |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |
VOICE_SDK_API VoiceSdkShortArray* VoiceSdkWavUtilsReadFromFileAsPcm16Samples | ( | const char * | wav_path, |
size_t * | sample_rate, | ||
char ** | error_msg | ||
) |
Reads WAV file as a PCM16 samples buffer (WAV file can be of any format)
[in] | wav_path | path to WAV file |
[out] | sample_rate | returns sample rate of WAV file |
[out] | error_msg | output error message. Points to the null-terminated string containing message in case of failure or to the NULL in case of success. The memory it points to should be freed manually. |