VoiceSDK  5.0.2
Classes | Macros | Typedefs | Enumerations | Functions
core_c_api.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include "config.h"

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 VoiceSdkLicenseFeatureInfoVoiceSdkGetLicenseInfo (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 VoiceSdkVoiceTemplateVoiceSdkVoiceTemplateLoadFromFile (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 VoiceSdkVoiceTemplateVoiceSdkVoiceTemplateDeserialize (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...
 

Macro Definition Documentation

◆ DECL_TYPED_ARRAY

#define DECL_TYPED_ARRAY (   name,
  type 
)
Value:
typedef struct { \
size_t size; \
type* data; \
} name; \
\
VOICE_SDK_API \
name* name##Create(size_t size); \
\
VOICE_SDK_API \
void name##Release(name* wrapped); \
\
/* nested create/release are only used internally */ \
void name##CreateNested(name* wrapped, size_t size); \
void name##ReleaseNested(name* wrapped); \
\

Typedef Documentation

◆ VoiceSdkAudioInfo

◆ VoiceSdkAudioInterval

◆ VoiceSdkBuildInfo

◆ VoiceSdkChannelType

◆ VoiceSdkErrorCode

Enumeration of the error codes which can be returned from the VoiceSDK API.

◆ VoiceSdkLicenseExpirationDate

◆ VoiceSdkLicenseFeature

VoiceSDK licensed features.

◆ VoiceSdkLicenseFeatureInfo

DocSDK feature information.

◆ VoiceSdkVoiceTemplate

Enumeration Type Documentation

◆ VoiceSdkChannelType

Enumerator
CHANNEL_TYPE_MIC 
CHANNEL_TYPE_TEL 
CHANNEL_TYPE_MIXED 

◆ VoiceSdkErrorCode

Enumeration of the error codes which can be returned from the VoiceSDK API.

Enumerator
kVoiceSdkErrorCodeOk 

Successful API call, no error returned

kVoiceSdkErrorCodeNullPointer 

NULL value has been passed to the SDK API function

kVoiceSdkErrorCodeInvalidArgument 

Deprecated, kVoiceSdkErrorCodeRuntimeError will be set instead. One of the arguments passed to the SDK API function is invalid

kVoiceSdkErrorCodeRuntimeError 

An error occurred during SDK API function execution

kVoiceSdkErrorCodeLicenseError 

License exception was thrown by underlying C++ code

◆ VoiceSdkLicenseFeature

VoiceSDK licensed features.

Enumerator
kVoiceSdkLicenseFeatureCore 

Core functionality

kVoiceSdkLicenseFeatureVerification 

Voice verification

kVoiceSdkLicenseFeatureLivenessPresentationAttackDetection 

Voice liveness (presentation/replay attack detection)

kVoiceSdkLicenseFeatureLivenessVoiceClonesDetection 

Voice liveness (voice clones detection)

kVoiceSdkLicenseFeatureQualityChecking 

Quality checking functionality (SNR, speech length etc.)

Function Documentation

◆ VoiceSdkGetBuildInfo()

VOICE_SDK_API void VoiceSdkGetBuildInfo ( VoiceSdkBuildInfo build_info)

Returns present VoiceSDK build info.

Parameters
[out]build_infoBuild info to fill, pointer to preallocated structure instance. You do not need to free the nested strings.

◆ VoiceSdkGetLicenseExpirationDate()

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.

Deprecated:
Use instead.
Returns
license expiration date

◆ VoiceSdkGetLicenseInfo()

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.

Parameters
[out]num_license_featuresnumber of enabled VoiceSDK features.
[out]error_codepointer to the error code.
[out]error_msgoutput 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.
Returns
Array of VoiceSDK features available with the installed license.

◆ VoiceSdkLicenseFeatureInfoArrayRelease()

VOICE_SDK_API void VoiceSdkLicenseFeatureInfoArrayRelease ( VoiceSdkLicenseFeatureInfo license_info)

Releases VoiceSdkLicenseFeatureInfo array.

Parameters
[in]license_infopointer to arrays of VoiceSdkLicenseFeatureInfo

◆ VoiceSdkOpusUtilsReadFromBufferAsPcm16Samples()

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.

Parameters
[in]datamemory buffer containing complete Opus file contents
[in]data_sizememory buffer length
[out]sample_ratereturns sample rate of Opus file
[out]error_msgoutput 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.
Returns
array of PCM16 samples

◆ VoiceSdkSetAllowMobileGpu()

VOICE_SDK_API void VoiceSdkSetAllowMobileGpu ( bool  allow_mobile_gpu)

Sets whether GPU delegate allowed to be used for VoiceSDK (for Android devices only).

Parameters
[in]allow_mobile_gpuwhether GPU is allowed to be used for VoiceSDK execution.

◆ VoiceSdkSetAllowMobileNnapi()

VOICE_SDK_API void VoiceSdkSetAllowMobileNnapi ( bool  allow_mobile_nnapi)

Sets whether NNAPI delegate allowed to be used for VoiceSDK (for Android devices only).

Parameters
[in]allow_mobile_nnapiwhether NNAPI is allowed to be used for VoiceSDK execution.

◆ VoiceSdkSetMobileLicense()

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

Parameters
[in]mobile_license_stringmobile SDK license string.
[out]error_msgoutput error message
Return values
trueif the invocation was successful, false in case of any errors

◆ VoiceSdkSetNumThreads()

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

Parameters
[in]num_threadsmaximum number of threads available for VoiceSDK.

◆ VoiceSdkSetUseVoiceTemplateCompression()

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.

Parameters
[in]use_voice_template_compressionwhether to compress voice templates serialization.

◆ VoiceSdkVoiceTemplateDeserialize()

VOICE_SDK_API VoiceSdkVoiceTemplate* VoiceSdkVoiceTemplateDeserialize ( const uint8_t *  array,
size_t  array_size,
char **  error_msg 
)

Deserializes voice template from the array.

Parameters
[in]arrayserialized template
[in]array_sizesize of serialized template
[out]error_msgoutput error message
Returns
VoiceSdkVoiceTemplate* or NULL in case of any errors

◆ VoiceSdkVoiceTemplateGetChannelType()

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.

Parameters
[in]voice_templatepointer to VoiceSdkVoiceTemplate
[out]channel_typepointer to VoiceSdkChannelType
[out]error_msgoutput error message
Return values
trueif the invocation was successful, false in case of any errors

◆ VoiceSdkVoiceTemplateGetInitDataId()

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.

Parameters
[in]voice_templatepointer to VoiceSdkVoiceTemplate
[out]error_msgoutput error message
Returns
string containing init data ID or NULL in case of any errors. You do not need to free the returned string.

◆ VoiceSdkVoiceTemplateIsValid()

VOICE_SDK_API bool VoiceSdkVoiceTemplateIsValid ( const VoiceSdkVoiceTemplate voice_template,
bool *  is_valid,
char **  error_msg 
)

Checks if voice template is valid or not.

Parameters
[in]voice_templatepointer to VoiceSdkVoiceTemplate
[out]is_validtrue if voice template is valid, false otherwise
[out]error_msgoutput error message
Return values
trueif the invocation was successful, false in case of any errors

◆ VoiceSdkVoiceTemplateLoadFromFile()

VOICE_SDK_API VoiceSdkVoiceTemplate* VoiceSdkVoiceTemplateLoadFromFile ( const char *  filepath,
char **  error_msg 
)

Loads voice template from the file.

Parameters
[in]filepathpath to the input file
[out]error_msgoutput error message
Returns
VoiceSdkVoiceTemplate* or NULL in case of any errors

◆ VoiceSdkVoiceTemplateRelease()

VOICE_SDK_API void VoiceSdkVoiceTemplateRelease ( VoiceSdkVoiceTemplate voice_template)

Releases VoiceSdkVoiceTemplate.

Parameters
[in]voice_templatepointer to VoiceSdkVoiceTemplate

◆ VoiceSdkVoiceTemplateSaveToFile()

VOICE_SDK_API bool VoiceSdkVoiceTemplateSaveToFile ( const VoiceSdkVoiceTemplate voice_template,
const char *  filepath,
char **  error_msg 
)

Saves voice template to the file.

Parameters
[in]voice_templatepointer to VoiceSdkVoiceTemplate
[in]filepathpath to the output file
[out]error_msgoutput error message
Return values
trueif the invocation was successful, false in case of any errors

◆ VoiceSdkVoiceTemplateSerialize()

VOICE_SDK_API VoiceSdkByteArray* VoiceSdkVoiceTemplateSerialize ( const VoiceSdkVoiceTemplate voice_template,
char **  error_msg 
)

Serializes voice template to the array.

Parameters
[in]voice_templatepointer to VoiceSdkVoiceTemplate
[out]error_msgoutput error message
Returns
VoiceSdkByteArray* or NULL in case of any errors

◆ VoiceSdkWavUtilsGetAudioInfoFromBuffer()

VOICE_SDK_API bool VoiceSdkWavUtilsGetAudioInfoFromBuffer ( const uint8_t *  data,
size_t  data_size,
VoiceSdkAudioInfo result,
char **  error_msg 
)

Returns WAV file audio info.

Parameters
[in]datamemory buffer containing complete WAV file contents
[in]data_sizememory buffer length
[out]resultresult of the call, pointer to preallocated structure instance
[out]error_msgoutput 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.
Returns
true if call completed successfully, false otherwise

◆ VoiceSdkWavUtilsGetAudioInfoFromFile()

VOICE_SDK_API bool VoiceSdkWavUtilsGetAudioInfoFromFile ( const char *  wav_path,
VoiceSdkAudioInfo result,
char **  error_msg 
)

Returns WAV file audio info.

Parameters
[in]wav_pathpath to WAV file
[out]resultresult of the call, pointer to preallocated structure instance
[out]error_msgoutput 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.
Returns
true if call completed successfully, false otherwise

◆ VoiceSdkWavUtilsReadFromBufferAs16BitFloatSamples()

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)

Parameters
[in]datamemory buffer containing complete WAV file contents
[in]data_sizememory buffer length
[out]sample_ratereturns sample rate of WAV file
[out]error_msgoutput 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.
Returns
array of float samples with 16-bit precision

◆ VoiceSdkWavUtilsReadFromBufferAsFloatSamples()

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)

Parameters
[in]datamemory buffer containing complete WAV file contents
[in]data_sizememory buffer length
[out]sample_ratereturns sample rate of WAV file
[out]error_msgoutput 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.
Returns
array of float samples

◆ VoiceSdkWavUtilsReadFromBufferAsPcm16Bytes()

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)

Parameters
[in]datamemory buffer containing complete WAV file contents
[in]data_sizememory buffer length
[out]sample_ratereturns sample rate of WAV file
[out]error_msgoutput 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.
Returns
array of bytes, containing little-endian PCM16 samples

◆ VoiceSdkWavUtilsReadFromBufferAsPcm16Samples()

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)

Parameters
[in]datamemory buffer containing complete WAV file contents
[in]data_sizememory buffer length
[out]sample_ratereturns sample rate of WAV file
[out]error_msgoutput 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.
Returns
array of PCM16 samples

◆ VoiceSdkWavUtilsReadFromFileAs16BitFloatSamples()

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)

Parameters
[in]wav_pathpath to WAV file
[out]sample_ratereturns sample rate of WAV file
[out]error_msgoutput 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.
Returns
array of float samples with 16-bit precision

◆ VoiceSdkWavUtilsReadFromFileAsFloatSamples()

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)

Parameters
[in]wav_pathpath to WAV file
[out]sample_ratereturns sample rate of WAV file
[out]error_msgoutput 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.
Returns
array of float samples

◆ VoiceSdkWavUtilsReadFromFileAsPcm16Bytes()

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)

Parameters
[in]wav_pathpath to WAV file
[out]sample_ratereturns sample rate of WAV file
[out]error_msgoutput 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.
Returns
array of bytes, containing little-endian PCM16 samples

◆ VoiceSdkWavUtilsReadFromFileAsPcm16Samples()

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)

Parameters
[in]wav_pathpath to WAV file
[out]sample_ratereturns sample rate of WAV file
[out]error_msgoutput 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.
Returns
array of PCM16 samples