VoiceSDK  5.0.2
Classes | Typedefs | Enumerations | Functions
media_c_api.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <voicesdk/core/core_c_api.h>

Go to the source code of this file.

Classes

struct  VoiceSdkSpeechEvent
 
struct  VoiceSdkSpeechInfo
 
struct  VoiceSdkSpeechSummary
 
struct  VoiceSdkQualityCheckMetricsThresholds
 
struct  VoiceSdkQualityCheckEngineResult
 

Typedefs

typedef struct VoiceSdkSpeechSummaryEngine VoiceSdkSpeechSummaryEngine
 
typedef struct VoiceSdkSpeechSummaryStream VoiceSdkSpeechSummaryStream
 
typedef struct VoiceSdkSpeechSummaryStreamOpus VoiceSdkSpeechSummaryStreamOpus
 
typedef struct VoiceSdkSnrComputer VoiceSdkSnrComputer
 
typedef struct VoiceSdkSpeechEndpointDetector VoiceSdkSpeechEndpointDetector
 
typedef struct VoiceSdkSpeechEndpointDetectorOpus VoiceSdkSpeechEndpointDetectorOpus
 
typedef struct VoiceSdkQualityCheckEngine VoiceSdkQualityCheckEngine
 
typedef struct VoiceSdkSpeechEvent VoiceSdkSpeechEvent
 
typedef struct VoiceSdkSpeechInfo VoiceSdkSpeechInfo
 
typedef struct VoiceSdkSpeechSummary VoiceSdkSpeechSummary
 
typedef enum VoiceSdkQualityCheckShortDescription VoiceSdkQualityCheckShortDescription
 
typedef enum VoiceSdkQualityCheckScenario VoiceSdkQualityCheckScenario
 
typedef struct VoiceSdkQualityCheckMetricsThresholds VoiceSdkQualityCheckMetricsThresholds
 
typedef struct VoiceSdkQualityCheckEngineResult VoiceSdkQualityCheckEngineResult
 

Enumerations

enum  VoiceSdkQualityCheckShortDescription {
  kVoiceSdkQualityCheckShortDescriptionTooNoisy = 0, kVoiceSdkQualityCheckShortDescriptionTooSmallSpeechLength = 1, kVoiceSdkQualityCheckShortDescriptionOk = 2, kVoiceSdkQualityCheckShortDescriptionTooSmallSpeechRelativeLength = 3,
  kVoiceSdkQualityCheckShortDescriptionMultipleSpeakersDetected = 4
}
 
enum  VoiceSdkQualityCheckScenario {
  kVoiceSdkQualityCheckScenarioVerifyTiEnrollment = 0, kVoiceSdkQualityCheckScenarioVerifyTiVerification = 1, kVoiceSdkQualityCheckScenarioVerifyTdEnrollment = 2, kVoiceSdkQualityCheckScenarioVerifyTdVerification = 3,
  kVoiceSdkQualityCheckScenarioLiveness = 4
}
 

Functions

VOICE_SDK_API VoiceSdkSpeechSummaryEngineVoiceSdkSpeechSummaryEngineCreate (const char *init_data_path, char **error_msg)
 Creates new instance of VoiceSdkSpeechSummaryEngine from the provided initialization data path. More...
 
VOICE_SDK_API VoiceSdkSpeechSummaryVoiceSdkSpeechSummaryEngineGetSpeechSummaryFromBytes (const VoiceSdkSpeechSummaryEngine *engine, const uint8_t *bytes, size_t bytes_num, size_t sample_rate, char **error_msg)
 Calculates speech summary with given PCM16 audio samples represented as bytes. The returned Speech Summary needs to be cleaned up manually. More...
 
VOICE_SDK_API VoiceSdkSpeechSummaryVoiceSdkSpeechSummaryEngineGetSpeechSummaryFromPcm16Samples (const VoiceSdkSpeechSummaryEngine *engine, const int16_t *pcm16_samples, size_t samples_num, size_t sample_rate, char **error_msg)
 Calculates speech summary with given PCM16 audio samples represented as 2-byte shorts. The returned Speech Summary needs to be cleaned up manually. More...
 
VOICE_SDK_API VoiceSdkSpeechSummaryVoiceSdkSpeechSummaryEngineGetSpeechSummaryFromFloatSamples (const VoiceSdkSpeechSummaryEngine *engine, const float *float_samples, size_t samples_num, size_t sample_rate, char **error_msg)
 Calculates speech summary with given PCM16 audio samples represented as normalised, i.e., having [-1, 1] range floats. The returned Speech Summary needs to be cleaned up manually. More...
 
VOICE_SDK_API VoiceSdkSpeechSummaryVoiceSdkSpeechSummaryEngineGetSpeechSummaryFromFile (const VoiceSdkSpeechSummaryEngine *engine, const char *audio_path, char **error_msg)
 Calculates speech summary from given audio file. The returned Speech Summary needs to be cleaned up manually. More...
 
VOICE_SDK_API void VoiceSdkSpeechSummaryEngineRelease (VoiceSdkSpeechSummaryEngine *engine)
 Releases all memory allocated for this VoiceSdkSpeechSummaryEngine instance. More...
 
VOICE_SDK_API void VoiceSdkSpeechSummaryRelease (VoiceSdkSpeechSummary *summary)
 Releases all memory allocated for this VoiceSdkSpeechSummary instance. This includes all nested structures as well. More...
 
VOICE_SDK_API VoiceSdkSpeechSummaryStreamVoiceSdkSpeechSummaryStreamCreate (const VoiceSdkSpeechSummaryEngine *engine, size_t sample_rate, char **error_msg)
 Creates new instance of VoiceSdkSpeechSummaryStream from the VoiceSdkSpeechSummaryEngine. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamAddByteSamples (const VoiceSdkSpeechSummaryStream *stream, const uint8_t *bytes, size_t bytes_num, char **error_msg)
 Adds input samples to the stream and recalculates speech/background lengths and speech events. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamAddPcm16Samples (const VoiceSdkSpeechSummaryStream *stream, const int16_t *pcm16_samples, size_t samples_num, char **error_msg)
 Adds input samples to the stream and recalculates speech/background lengths and speech events. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamAddFloatSamples (const VoiceSdkSpeechSummaryStream *stream, const float *float_samples, size_t samples_num, char **error_msg)
 Adds input samples to the stream and recalculates speech/background lengths and speech events. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamGetCurrentBackgroundLength (const VoiceSdkSpeechSummaryStream *stream, float *result, char **error_msg)
 Returns current background length (length of a continuous non-speech segment starting on the last detected speech frame). More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamHasSpeechEvents (const VoiceSdkSpeechSummaryStream *stream, bool *result, char **error_msg)
 Check whether or not the stream has any pending speech events to be consumed. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamGetSpeechEvent (const VoiceSdkSpeechSummaryStream *stream, VoiceSdkSpeechEvent *result, char **error_msg)
 Retrieves pending speech event from the stream. Only use this if VoiceSdkSpeechSummaryStreamHasSpeechEvents returns true. More...
 
VOICE_SDK_API VoiceSdkSpeechSummaryVoiceSdkSpeechSummaryStreamGetTotalSpeechSummary (const VoiceSdkSpeechSummaryStream *stream, char **error_msg)
 Retrieves total speech summary, that is, over all added samples, from the stream. The returned Speech Summary needs to be cleaned up manually. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamGetTotalSpeechInfo (const VoiceSdkSpeechSummaryStream *stream, VoiceSdkSpeechInfo *result, char **error_msg)
 Retrieves total accumulated speech info. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamReset (const VoiceSdkSpeechSummaryStream *stream, char **error_msg)
 Resets the stream, cleaning up internal state, any leftover internal buffers and pending events. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamFinalize (const VoiceSdkSpeechSummaryStream *stream, char **error_msg)
 Finalizes input audio stream to process remaining audio samples and produce result if it's possible. More...
 
VOICE_SDK_API void VoiceSdkSpeechSummaryStreamRelease (VoiceSdkSpeechSummaryStream *stream)
 Releases all memory allocated for this VoiceSdkSpeechSummaryStream instance. More...
 
VOICE_SDK_API VoiceSdkSpeechSummaryStreamOpusVoiceSdkSpeechSummaryStreamOpusCreate (const char *init_data_path, size_t sample_rate, char **error_msg)
 Creates new instance of VoiceSdkSpeechSummaryStreamOpus from the initialization data. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusAddPacket (const VoiceSdkSpeechSummaryStreamOpus *stream, const uint8_t *bytes, size_t bytes_num, char **error_msg)
 Adds Opus packet to process. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusGetCurrentBackgroundLength (const VoiceSdkSpeechSummaryStreamOpus *stream, float *result, char **error_msg)
 Returns current background length (length of a continuous non-speech segment starting on the last detected speech frame). More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusHasSpeechEvents (const VoiceSdkSpeechSummaryStreamOpus *stream, bool *result, char **error_msg)
 Check whether or not the stream has any pending speech events to be consumed. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusGetSpeechEvent (const VoiceSdkSpeechSummaryStreamOpus *stream, VoiceSdkSpeechEvent *result, char **error_msg)
 Retrieves pending speech event from the stream. Only use this if VoiceSdkSpeechSummaryStreamOpusHasSpeechEvents returns true. More...
 
VOICE_SDK_API VoiceSdkSpeechSummaryVoiceSdkSpeechSummaryStreamOpusGetTotalSpeechSummary (const VoiceSdkSpeechSummaryStreamOpus *stream, char **error_msg)
 Retrieves total speech summary, that is, over all added samples, from the stream. The returned Speech Summary needs to be cleaned up manually. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusGetTotalSpeechInfo (const VoiceSdkSpeechSummaryStreamOpus *stream, VoiceSdkSpeechInfo *result, char **error_msg)
 Retrieves total accumulated speech info. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusReset (const VoiceSdkSpeechSummaryStreamOpus *stream, char **error_msg)
 Resets the stream, cleaning up internal state, any leftover internal buffers and pending events. More...
 
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusFinalize (const VoiceSdkSpeechSummaryStreamOpus *stream, char **error_msg)
 Finalizes input audio stream to process remaining audio samples and produce result if it's possible. More...
 
VOICE_SDK_API void VoiceSdkSpeechSummaryStreamOpusRelease (VoiceSdkSpeechSummaryStreamOpus *stream)
 Releases all memory allocated for this VoiceSdkSpeechSummaryStreamOpus instance. More...
 
VOICE_SDK_API VoiceSdkSnrComputerVoiceSdkSnrComputerCreate (const char *init_data_path, char **error_msg)
 Creates new SNR Computer instance. More...
 
VOICE_SDK_API bool VoiceSdkSnrComputerComputeFromBytes (const VoiceSdkSnrComputer *engine, const uint8_t *bytes, size_t bytes_num, size_t sample_rate, float *result, char **error_msg)
 Calculates Signal-To-Noise (SNR) value with given PCM16 audio samples represented as bytes. More...
 
VOICE_SDK_API bool VoiceSdkSnrComputerComputeFromPcm16Samples (const VoiceSdkSnrComputer *engine, const int16_t *pcm16_samples, size_t samples_num, size_t sample_rate, float *result, char **error_msg)
 Calculates Signal-To-Noise (SNR) value with given PCM16 audio samples represented as shorts. More...
 
VOICE_SDK_API bool VoiceSdkSnrComputerComputeFromFloatSamples (const VoiceSdkSnrComputer *engine, const float *float_samples, size_t samples_num, size_t sample_rate, float *result, char **error_msg)
 Calculates Signal-To-Noise (SNR) value with given PCM16 audio samples represented as normalised, i.e., having [-1, 1] range floats. More...
 
VOICE_SDK_API bool VoiceSdkSnrComputerComputeFromFile (const VoiceSdkSnrComputer *engine, const char *audio_path, float *result, char **error_msg)
 Calculates Signal-To-Noise (SNR) value from given audio file. More...
 
VOICE_SDK_API void VoiceSdkSnrComputerRelease (VoiceSdkSnrComputer *engine)
 Releases all memory allocated for this VoiceSdkSnrComputer instance. More...
 
VOICE_SDK_API VoiceSdkSpeechEndpointDetectorVoiceSdkSpeechEndpointDetectorCreate (size_t min_speech_length_ms, size_t max_silence_length_ms, size_t sample_rate, char **error_msg)
 Creates new instance of VoiceSdkSpeechEndpointDetector. More...
 
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorAddByteSamples (const VoiceSdkSpeechEndpointDetector *detector, const uint8_t *bytes, size_t bytes_num, char **error_msg)
 Adds PCM16 audio bytes to process. More...
 
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorAddPcm16Samples (const VoiceSdkSpeechEndpointDetector *detector, const int16_t *pcm16_samples, size_t samples_num, char **error_msg)
 Adds PCM16 audio samples to process. More...
 
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorAddFloatSamples (const VoiceSdkSpeechEndpointDetector *detector, const float *float_samples, size_t samples_num, char **error_msg)
 Adds float audio samples to process. More...
 
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorIsSpeechEnded (const VoiceSdkSpeechEndpointDetector *detector, bool *result, char **error_msg)
 Returns detection state. More...
 
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorReset (const VoiceSdkSpeechEndpointDetector *detector, char **error_msg)
 Resets detector state. More...
 
VOICE_SDK_API void VoiceSdkSpeechEndpointDetectorRelease (VoiceSdkSpeechEndpointDetector *detector)
 Releases all memory allocated for this VoiceSdkSpeechEndpointDetector instance. More...
 
VOICE_SDK_API VoiceSdkSpeechEndpointDetectorOpusVoiceSdkSpeechEndpointDetectorOpusCreate (size_t min_speech_length_ms, size_t max_silence_length_ms, size_t sample_rate, char **error_msg)
 Creates new instance of VoiceSdkSpeechEndpointDetectorOpus. More...
 
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusAddPacket (const VoiceSdkSpeechEndpointDetectorOpus *detector, const uint8_t *bytes, size_t bytes_num, char **error_msg)
 Adds Opus packet to process. More...
 
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusIsSpeechEnded (const VoiceSdkSpeechEndpointDetectorOpus *detector, bool *result, char **error_msg)
 Returns detection state. More...
 
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusReset (const VoiceSdkSpeechEndpointDetectorOpus *detector, char **error_msg)
 Resets detector state. More...
 
VOICE_SDK_API void VoiceSdkSpeechEndpointDetectorOpusRelease (VoiceSdkSpeechEndpointDetectorOpus *detector)
 Releases all memory allocated for this VoiceSdkSpeechEndpointDetectorOpus instance. More...
 
VOICE_SDK_API VoiceSdkQualityCheckEngineVoiceSdkQualityCheckEngineCreate (const char *init_data_path, VoiceSdkErrorCode *error_code, char **error_msg)
 Creates new Quality check engine instance. More...
 
VOICE_SDK_API bool VoiceSdkQualityCheckEngineGetRecommendedThresholds (const VoiceSdkQualityCheckEngine *engine, VoiceSdkQualityCheckScenario scenario, VoiceSdkQualityCheckMetricsThresholds *thresholds, VoiceSdkErrorCode *error_code, char **error_msg)
 Gets recommended quality checking thresholds for the specified scenario. More...
 
VOICE_SDK_API VoiceSdkQualityCheckEngineResultVoiceSdkQualityCheckEngineCheckQualityAudioFile (const VoiceSdkQualityCheckEngine *engine, const char *audio_path, VoiceSdkQualityCheckMetricsThresholds thresholds, VoiceSdkErrorCode *error_code, char **error_msg)
 Checks if audio file is suitable from the quality perspective, from the given audio file. More...
 
VOICE_SDK_API VoiceSdkQualityCheckEngineResultVoiceSdkQualityCheckEngineCheckQualityFloatSamples (const VoiceSdkQualityCheckEngine *engine, const float *float_samples, size_t num_samples, size_t sample_rate, VoiceSdkQualityCheckMetricsThresholds thresholds, VoiceSdkErrorCode *error_code, char **error_msg)
 Checks if audio buffer is suitable from the quality perspective, from the given float audio samples. More...
 
VOICE_SDK_API VoiceSdkQualityCheckEngineResultVoiceSdkQualityCheckEngineCheckQualityPcm16Samples (const VoiceSdkQualityCheckEngine *engine, const int16_t *samples, size_t num_samples, size_t sample_rate, VoiceSdkQualityCheckMetricsThresholds thresholds, VoiceSdkErrorCode *error_code, char **error_msg)
 Checks if audio buffer is suitable from the quality perspective, from the given PCM16 audio samples. More...
 
VOICE_SDK_API VoiceSdkQualityCheckEngineResultVoiceSdkQualityCheckEngineCheckQualityBytes (const VoiceSdkQualityCheckEngine *engine, const uint8_t *bytes, size_t num_bytes, size_t sample_rate, VoiceSdkQualityCheckMetricsThresholds thresholds, VoiceSdkErrorCode *error_code, char **error_msg)
 Checks if audio buffer is suitable from the quality perspective, from the given PCM16 audio bytes. More...
 
VOICE_SDK_API void VoiceSdkQualityCheckEngineResultRelease (VoiceSdkQualityCheckEngineResult *check_result)
 Releases VoiceSdkQualityCheckEngineResult. More...
 
VOICE_SDK_API void VoiceSdkQualityCheckEngineRelease (VoiceSdkQualityCheckEngine *engine)
 Releases all memory allocated for this VoiceSdkQualityCheckEngine instance. More...
 

Typedef Documentation

◆ VoiceSdkQualityCheckEngine

◆ VoiceSdkQualityCheckEngineResult

◆ VoiceSdkQualityCheckMetricsThresholds

◆ VoiceSdkQualityCheckScenario

◆ VoiceSdkQualityCheckShortDescription

◆ VoiceSdkSnrComputer

◆ VoiceSdkSpeechEndpointDetector

◆ VoiceSdkSpeechEndpointDetectorOpus

◆ VoiceSdkSpeechEvent

◆ VoiceSdkSpeechInfo

◆ VoiceSdkSpeechSummary

◆ VoiceSdkSpeechSummaryEngine

◆ VoiceSdkSpeechSummaryStream

◆ VoiceSdkSpeechSummaryStreamOpus

Enumeration Type Documentation

◆ VoiceSdkQualityCheckScenario

Enumerator
kVoiceSdkQualityCheckScenarioVerifyTiEnrollment 

Verification, TI enrollment step.

kVoiceSdkQualityCheckScenarioVerifyTiVerification 

Verification, TI verification step.

kVoiceSdkQualityCheckScenarioVerifyTdEnrollment 

Verification, TD enrollment step.

kVoiceSdkQualityCheckScenarioVerifyTdVerification 

Verification, TD verification step.

kVoiceSdkQualityCheckScenarioLiveness 

Liveness check.

◆ VoiceSdkQualityCheckShortDescription

Enumerator
kVoiceSdkQualityCheckShortDescriptionTooNoisy 

Audio is too noisy.

kVoiceSdkQualityCheckShortDescriptionTooSmallSpeechLength 

Speech length in the audio is too small.

kVoiceSdkQualityCheckShortDescriptionOk 

Audio successfully passed quality check.

kVoiceSdkQualityCheckShortDescriptionTooSmallSpeechRelativeLength 

Speech relative length (speech length relative to the total audio length) is too small.

kVoiceSdkQualityCheckShortDescriptionMultipleSpeakersDetected 

Multiple speakers detected.

Function Documentation

◆ VoiceSdkQualityCheckEngineCheckQualityAudioFile()

VOICE_SDK_API VoiceSdkQualityCheckEngineResult* VoiceSdkQualityCheckEngineCheckQualityAudioFile ( const VoiceSdkQualityCheckEngine engine,
const char *  audio_path,
VoiceSdkQualityCheckMetricsThresholds  thresholds,
VoiceSdkErrorCode error_code,
char **  error_msg 
)

Checks if audio file is suitable from the quality perspective, from the given audio file.

Parameters
[in]enginepointer to VoiceSdkQualityCheckEngine.
[in]audio_pathpath to an audio file.
[in]thresholdsquality checking thresholds that will be applied to the output quality check metrics.
[out]error_codepointer to the error code.
[out]error_msgoutput error message.
Returns
VoiceSdkQualityCheckEngineResult* or NULL in case of any errors.
See also
VoiceSdkQualityCheckEngineResultRelease

◆ VoiceSdkQualityCheckEngineCheckQualityBytes()

VOICE_SDK_API VoiceSdkQualityCheckEngineResult* VoiceSdkQualityCheckEngineCheckQualityBytes ( const VoiceSdkQualityCheckEngine engine,
const uint8_t *  bytes,
size_t  num_bytes,
size_t  sample_rate,
VoiceSdkQualityCheckMetricsThresholds  thresholds,
VoiceSdkErrorCode error_code,
char **  error_msg 
)

Checks if audio buffer is suitable from the quality perspective, from the given PCM16 audio bytes.

Parameters
[in]enginepointer to VoiceSdkQualityCheckEngine.
[in]bytesbuffer containing byte representation of PCM16 audio samples.
[in]num_bytesnumber of bytes.
[in]sample_rateaudio sampling rate in hz.
[in]thresholdsquality checking thresholds that will be applied to the output quality check metrics.
[out]error_codepointer to the error code.
[out]error_msgoutput error message.
Returns
VoiceSdkQualityCheckResult* or NULL in case of any errors.
See also
VoiceSdkQualityCheckEngineResultRelease

◆ VoiceSdkQualityCheckEngineCheckQualityFloatSamples()

VOICE_SDK_API VoiceSdkQualityCheckEngineResult* VoiceSdkQualityCheckEngineCheckQualityFloatSamples ( const VoiceSdkQualityCheckEngine engine,
const float *  float_samples,
size_t  num_samples,
size_t  sample_rate,
VoiceSdkQualityCheckMetricsThresholds  thresholds,
VoiceSdkErrorCode error_code,
char **  error_msg 
)

Checks if audio buffer is suitable from the quality perspective, from the given float audio samples.

Parameters
[in]enginepointer to VoiceSdkQualityCheckEngine.
[in]float_samplesbuffer containing normalized (from -1 to 1) float audio samples.
[in]num_samplesnumber of audio samples.
[in]sample_rateaudio sampling rate in hz.
[in]thresholdsquality checking thresholds that will be applied to the output quality check metrics.
[out]error_codepointer to the error code.
[out]error_msgoutput error message.
Returns
VoiceSdkQualityCheckResult* or NULL in case of any errors.
See also
VoiceSdkQualityCheckEngineResultRelease

◆ VoiceSdkQualityCheckEngineCheckQualityPcm16Samples()

VOICE_SDK_API VoiceSdkQualityCheckEngineResult* VoiceSdkQualityCheckEngineCheckQualityPcm16Samples ( const VoiceSdkQualityCheckEngine engine,
const int16_t *  samples,
size_t  num_samples,
size_t  sample_rate,
VoiceSdkQualityCheckMetricsThresholds  thresholds,
VoiceSdkErrorCode error_code,
char **  error_msg 
)

Checks if audio buffer is suitable from the quality perspective, from the given PCM16 audio samples.

Parameters
[in]enginepointer to VoiceSdkQualityCheckEngine.
[in]samplesbuffer containing PCM16 audio samples.
[in]num_samplesnumber of audio samples.
[in]sample_rateaudio sampling rate in hz.
[in]thresholdsquality checking thresholds that will be applied to the output quality check metrics.
[out]error_codepointer to the error code.
[out]error_msgoutput error message.
Returns
VoiceSdkQualityCheckResult* or NULL in case of any errors.
See also
VoiceSdkQualityCheckEngineResultRelease

◆ VoiceSdkQualityCheckEngineCreate()

VOICE_SDK_API VoiceSdkQualityCheckEngine* VoiceSdkQualityCheckEngineCreate ( const char *  init_data_path,
VoiceSdkErrorCode error_code,
char **  error_msg 
)

Creates new Quality check engine instance.

The returned value is used for any subsequent quality check calls. The engine must be released by calling VoiceSdkQualityCheckEngineRelease after it is no longer needed.

Parameters
[in]init_data_pathfilesystem path for the initialization data folder.
[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
VoiceSdkQualityCheckEngine* newly created instance of SNR Computer or NULL in case of any errors.
See also
VoiceSdkQualityCheckEngineRelease

◆ VoiceSdkQualityCheckEngineGetRecommendedThresholds()

VOICE_SDK_API bool VoiceSdkQualityCheckEngineGetRecommendedThresholds ( const VoiceSdkQualityCheckEngine engine,
VoiceSdkQualityCheckScenario  scenario,
VoiceSdkQualityCheckMetricsThresholds thresholds,
VoiceSdkErrorCode error_code,
char **  error_msg 
)

Gets recommended quality checking thresholds for the specified scenario.

Parameters
[in]enginepointer to VoiceSdkQualityCheckEngine.
[in]scenarioscenario for which recommended thresholds will be returned.
[out]thresholdsreturned quality check thresholds that can be used on quality checking, pointer to preallocated structure instance. Not changed unless this call returns true.
[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
true if call completed successfully, false otherwise.

◆ VoiceSdkQualityCheckEngineRelease()

VOICE_SDK_API void VoiceSdkQualityCheckEngineRelease ( VoiceSdkQualityCheckEngine engine)

Releases all memory allocated for this VoiceSdkQualityCheckEngine instance.

Parameters
engineinstance of VoiceSdkQualityCheckEngine that needs freeing

◆ VoiceSdkQualityCheckEngineResultRelease()

VOICE_SDK_API void VoiceSdkQualityCheckEngineResultRelease ( VoiceSdkQualityCheckEngineResult check_result)

Releases VoiceSdkQualityCheckEngineResult.

Parameters
[in]check_resultpointer to VoiceSdkQualityCheckEngineResult

◆ VoiceSdkSnrComputerComputeFromBytes()

VOICE_SDK_API bool VoiceSdkSnrComputerComputeFromBytes ( const VoiceSdkSnrComputer engine,
const uint8_t *  bytes,
size_t  bytes_num,
size_t  sample_rate,
float *  result,
char **  error_msg 
)

Calculates Signal-To-Noise (SNR) value with given PCM16 audio samples represented as bytes.

Parameters
[in]engineinstance of SNR Computer created with VoiceSdkSnrComputerCreate
[in]bytespointer to byte array containing PCM16 audio samples. Each two bytes make up one little-endian sample.
[in]bytes_numsize of the byte array
[in]sample_ratesample rate of the passed audio
[out]resultresulting SNR value for requested data, 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

◆ VoiceSdkSnrComputerComputeFromFile()

VOICE_SDK_API bool VoiceSdkSnrComputerComputeFromFile ( const VoiceSdkSnrComputer engine,
const char *  audio_path,
float *  result,
char **  error_msg 
)

Calculates Signal-To-Noise (SNR) value from given audio file.

Parameters
[in]engineinstance of SNR Computer created with VoiceSdkSnrComputerCreate
[in]audio_pathpath to audio file on the filesystem
[out]resultresulting SNR value for requested data, 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

◆ VoiceSdkSnrComputerComputeFromFloatSamples()

VOICE_SDK_API bool VoiceSdkSnrComputerComputeFromFloatSamples ( const VoiceSdkSnrComputer engine,
const float *  float_samples,
size_t  samples_num,
size_t  sample_rate,
float *  result,
char **  error_msg 
)

Calculates Signal-To-Noise (SNR) value with given PCM16 audio samples represented as normalised, i.e., having [-1, 1] range floats.

Parameters
[in]engineinstance of SNR Computer created with VoiceSdkSnrComputerCreate
[in]float_samplespointer to floats array containing PCM16 audio samples
[in]samples_numsize of the floats array
[in]sample_ratesample rate of the passed audio
[out]resultresulting SNR value for requested data, 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

◆ VoiceSdkSnrComputerComputeFromPcm16Samples()

VOICE_SDK_API bool VoiceSdkSnrComputerComputeFromPcm16Samples ( const VoiceSdkSnrComputer engine,
const int16_t *  pcm16_samples,
size_t  samples_num,
size_t  sample_rate,
float *  result,
char **  error_msg 
)

Calculates Signal-To-Noise (SNR) value with given PCM16 audio samples represented as shorts.

Parameters
[in]engineinstance of SNR Computer created with VoiceSdkSnrComputerCreate
[in]pcm16_samplespointer to shorts array containing PCM16 audio samples
[in]samples_numsize of the shorts array
[in]sample_ratesample rate of the passed audio
[out]resultresulting SNR value for requested data, 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

◆ VoiceSdkSnrComputerCreate()

VOICE_SDK_API VoiceSdkSnrComputer* VoiceSdkSnrComputerCreate ( const char *  init_data_path,
char **  error_msg 
)

Creates new SNR Computer instance.

The returned value is used for any subsequent compute calls. The engine must be released by calling VoiceSdkSnrComputerRelease after it is no longer needed.

Parameters
[in]init_data_pathfilesystem path for the initialization data folder
[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
VoiceSdkSnrComputer* newly created instance of SNR Computer or NULL in case of any errors
See also
VoiceSdkSnrComputerRelease

◆ VoiceSdkSnrComputerRelease()

VOICE_SDK_API void VoiceSdkSnrComputerRelease ( VoiceSdkSnrComputer engine)

Releases all memory allocated for this VoiceSdkSnrComputer instance.

Parameters
engineinstance of VoiceSdkSnrComputer that needs freeing

◆ VoiceSdkSpeechEndpointDetectorAddByteSamples()

VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorAddByteSamples ( const VoiceSdkSpeechEndpointDetector detector,
const uint8_t *  bytes,
size_t  bytes_num,
char **  error_msg 
)

Adds PCM16 audio bytes to process.

Parameters
[in]detectorinstance of speech endpoint detector created with VoiceSdkSpeechEndpointDetectorCreate
[in]bytespointer to byte array containing PCM16 audio samples. Each two bytes make up one little-endian sample.
[in]bytes_numsize of array with bytes
[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

◆ VoiceSdkSpeechEndpointDetectorAddFloatSamples()

VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorAddFloatSamples ( const VoiceSdkSpeechEndpointDetector detector,
const float *  float_samples,
size_t  samples_num,
char **  error_msg 
)

Adds float audio samples to process.

Parameters
[in]detectorinstance of speech endpoint detector created with VoiceSdkSpeechEndpointDetectorCreate
[in]float_samplespointer to array containing normalized (from -1 to 1) float audio samples
[in]samples_numsize of array with float samples
[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

◆ VoiceSdkSpeechEndpointDetectorAddPcm16Samples()

VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorAddPcm16Samples ( const VoiceSdkSpeechEndpointDetector detector,
const int16_t *  pcm16_samples,
size_t  samples_num,
char **  error_msg 
)

Adds PCM16 audio samples to process.

Parameters
[in]detectorinstance of speech endpoint detector created with VoiceSdkSpeechEndpointDetectorCreate
[in]pcm16_samplespointer to shorts array containing PCM16 audio samples
[in]samples_numsize of array with PCM16 samples
[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

◆ VoiceSdkSpeechEndpointDetectorCreate()

VOICE_SDK_API VoiceSdkSpeechEndpointDetector* VoiceSdkSpeechEndpointDetectorCreate ( size_t  min_speech_length_ms,
size_t  max_silence_length_ms,
size_t  sample_rate,
char **  error_msg 
)

Creates new instance of VoiceSdkSpeechEndpointDetector.

The returned value is used for any subsequent VoiceSdkSpeechEndpointDetector* calls. The detector must be released by calling VoiceSdkSpeechEndpointDetectorRelease after it is no longer needed.

Parameters
[in]min_speech_length_msminimum speech length required to begin speech end detection (ms)
[in]max_silence_length_mssilence after speech threshold used to determine if speech is already ended (ms)
[in]sample_rateinput signal sampling rate
[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
VoiceSdkSpeechEndpointDetector* newly created instance of detector or NULL in case of any errors
See also
VoiceSdkSpeechEndpointDetectorRelease

◆ VoiceSdkSpeechEndpointDetectorIsSpeechEnded()

VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorIsSpeechEnded ( const VoiceSdkSpeechEndpointDetector detector,
bool *  result,
char **  error_msg 
)

Returns detection state.

Parameters
[in]detectorinstance of speech endpoint detector created with VoiceSdkSpeechEndpointDetectorCreate
[out]resulttrue if speech end was detected, false otherwise
[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

◆ VoiceSdkSpeechEndpointDetectorOpusAddPacket()

VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusAddPacket ( const VoiceSdkSpeechEndpointDetectorOpus detector,
const uint8_t *  bytes,
size_t  bytes_num,
char **  error_msg 
)

Adds Opus packet to process.

Parameters
[in]detectorinstance of speech endpoint detector opus created with VoiceSdkSpeechEndpointDetectorOpusCreate
[in]bytesA buffer containing single Opus packet. It is expected that packet contains data for single mono stream
[in]bytes_numsize of the buffer
[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

◆ VoiceSdkSpeechEndpointDetectorOpusCreate()

VOICE_SDK_API VoiceSdkSpeechEndpointDetectorOpus* VoiceSdkSpeechEndpointDetectorOpusCreate ( size_t  min_speech_length_ms,
size_t  max_silence_length_ms,
size_t  sample_rate,
char **  error_msg 
)

Creates new instance of VoiceSdkSpeechEndpointDetectorOpus.

The returned value is used for any subsequent VoiceSdkSpeechEndpointDetectorOpus* calls. The detector must be released by calling VoiceSdkSpeechEndpointDetectorOpusRelease after it is no longer needed.

Parameters
[in]min_speech_length_msminimum speech length required to begin speech end detection (ms)
[in]max_silence_length_mssilence after speech threshold used to determine if speech is already ended (ms)
[in]sample_rateinput signal sampling rate
[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
VoiceSdkSpeechEndpointDetectorOpus* newly created instance of detector or NULL in case of any errors
See also
VoiceSdkSpeechEndpointDetectorOpusRelease

◆ VoiceSdkSpeechEndpointDetectorOpusIsSpeechEnded()

VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusIsSpeechEnded ( const VoiceSdkSpeechEndpointDetectorOpus detector,
bool *  result,
char **  error_msg 
)

Returns detection state.

Parameters
[in]detectorinstance of speech endpoint detector created with VoiceSdkSpeechEndpointDetectorOpusCreate
[out]resulttrue if speech end was detected, false otherwise
[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

◆ VoiceSdkSpeechEndpointDetectorOpusRelease()

VOICE_SDK_API void VoiceSdkSpeechEndpointDetectorOpusRelease ( VoiceSdkSpeechEndpointDetectorOpus detector)

Releases all memory allocated for this VoiceSdkSpeechEndpointDetectorOpus instance.

Parameters
detectorinstance of VoiceSdkSpeechEndpointDetectorOpus that needs freeing

◆ VoiceSdkSpeechEndpointDetectorOpusReset()

VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusReset ( const VoiceSdkSpeechEndpointDetectorOpus detector,
char **  error_msg 
)

Resets detector state.

Parameters
[in]detectorinstance of speech endpoint detector created with VoiceSdkSpeechEndpointDetectorOpusCreate
[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

◆ VoiceSdkSpeechEndpointDetectorRelease()

VOICE_SDK_API void VoiceSdkSpeechEndpointDetectorRelease ( VoiceSdkSpeechEndpointDetector detector)

Releases all memory allocated for this VoiceSdkSpeechEndpointDetector instance.

Parameters
detectorinstance of VoiceSdkSpeechEndpointDetector that needs freeing

◆ VoiceSdkSpeechEndpointDetectorReset()

VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorReset ( const VoiceSdkSpeechEndpointDetector detector,
char **  error_msg 
)

Resets detector state.

Parameters
[in]detectorinstance of speech endpoint detector created with VoiceSdkSpeechEndpointDetectorCreate
[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

◆ VoiceSdkSpeechSummaryEngineCreate()

VOICE_SDK_API VoiceSdkSpeechSummaryEngine* VoiceSdkSpeechSummaryEngineCreate ( const char *  init_data_path,
char **  error_msg 
)

Creates new instance of VoiceSdkSpeechSummaryEngine from the provided initialization data path.

The returned value is used for any subsequent GetSpeechSummary calls or for creating streams. The engine must be released by calling VoiceSdkSpeechSummaryEngineRelease after it is no longer needed.

Note that VoiceSdkSpeechSummary instances returned by GetSpeechSummary calls remain valid after corresponding VoiceSdkSpeechSummaryEngine is released and can be used separately.

Parameters
[in]init_data_pathfilesystem path for the initialization data folder
[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
VoiceSdkSpeechSummaryEngine* newly created instance of Speech Summary Engine or NULL in case of any errors
See also
VoiceSdkSpeechSummaryEngineRelease

◆ VoiceSdkSpeechSummaryEngineGetSpeechSummaryFromBytes()

VOICE_SDK_API VoiceSdkSpeechSummary* VoiceSdkSpeechSummaryEngineGetSpeechSummaryFromBytes ( const VoiceSdkSpeechSummaryEngine engine,
const uint8_t *  bytes,
size_t  bytes_num,
size_t  sample_rate,
char **  error_msg 
)

Calculates speech summary with given PCM16 audio samples represented as bytes. The returned Speech Summary needs to be cleaned up manually.

Parameters
[in]engineinstance of Speech Summary Engine created with VoiceSdkSpeechSummaryEngineCreate
[in]bytespointer to byte array containing PCM16 audio samples. Each two bytes make up one little-endian sample.
[in]bytes_numsize of the byte array
[in]sample_ratesample rate of the passed audio
[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
VoiceSdkSpeechSummary* speech summary for requested data or NULL in case of any errors

◆ VoiceSdkSpeechSummaryEngineGetSpeechSummaryFromFile()

VOICE_SDK_API VoiceSdkSpeechSummary* VoiceSdkSpeechSummaryEngineGetSpeechSummaryFromFile ( const VoiceSdkSpeechSummaryEngine engine,
const char *  audio_path,
char **  error_msg 
)

Calculates speech summary from given audio file. The returned Speech Summary needs to be cleaned up manually.

Parameters
[in]engineinstance of Speech Summary Engine created with VoiceSdkSpeechSummaryEngineCreate
[in]audio_pathpath to audio file on the filesystem
[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
VoiceSdkSpeechSummary* speech summary for requested data or NULL in case of any errors

◆ VoiceSdkSpeechSummaryEngineGetSpeechSummaryFromFloatSamples()

VOICE_SDK_API VoiceSdkSpeechSummary* VoiceSdkSpeechSummaryEngineGetSpeechSummaryFromFloatSamples ( const VoiceSdkSpeechSummaryEngine engine,
const float *  float_samples,
size_t  samples_num,
size_t  sample_rate,
char **  error_msg 
)

Calculates speech summary with given PCM16 audio samples represented as normalised, i.e., having [-1, 1] range floats. The returned Speech Summary needs to be cleaned up manually.

Parameters
[in]engineinstance of Speech Summary Engine created with VoiceSdkSpeechSummaryEngineCreate
[in]float_samplespointer to floats array containing PCM16 audio samples
[in]samples_numsize of the floats array
[in]sample_ratesample rate of the passed audio
[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
VoiceSdkSpeechSummary* speech summary for requested data or NULL in case of any errors

◆ VoiceSdkSpeechSummaryEngineGetSpeechSummaryFromPcm16Samples()

VOICE_SDK_API VoiceSdkSpeechSummary* VoiceSdkSpeechSummaryEngineGetSpeechSummaryFromPcm16Samples ( const VoiceSdkSpeechSummaryEngine engine,
const int16_t *  pcm16_samples,
size_t  samples_num,
size_t  sample_rate,
char **  error_msg 
)

Calculates speech summary with given PCM16 audio samples represented as 2-byte shorts. The returned Speech Summary needs to be cleaned up manually.

Parameters
[in]engineinstance of Speech Summary Engine created with VoiceSdkSpeechSummaryEngineCreate
[in]pcm16_samplespointer to shorts array containing PCM16 audio samples
[in]samples_numsize of the shorts array
[in]sample_ratesample rate of the passed audio
[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
VoiceSdkSpeechSummary* speech summary for requested data or NULL in case of any errors

◆ VoiceSdkSpeechSummaryEngineRelease()

VOICE_SDK_API void VoiceSdkSpeechSummaryEngineRelease ( VoiceSdkSpeechSummaryEngine engine)

Releases all memory allocated for this VoiceSdkSpeechSummaryEngine instance.

Parameters
engineinstance of VoiceSdkSpeechSummaryEngine that needs freeing

◆ VoiceSdkSpeechSummaryRelease()

VOICE_SDK_API void VoiceSdkSpeechSummaryRelease ( VoiceSdkSpeechSummary summary)

Releases all memory allocated for this VoiceSdkSpeechSummary instance. This includes all nested structures as well.

This is meant to be used after using any GetSpeechSummary calls, after the returned object is no longer needed.

Parameters
summaryinstance of VoiceSdkSpeechSummary that needs freeing

◆ VoiceSdkSpeechSummaryStreamAddByteSamples()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamAddByteSamples ( const VoiceSdkSpeechSummaryStream stream,
const uint8_t *  bytes,
size_t  bytes_num,
char **  error_msg 
)

Adds input samples to the stream and recalculates speech/background lengths and speech events.

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[in]bytespointer to byte array containing PCM16 audio samples. Each two bytes make up one little-endian sample.
[in]bytes_numsize of the byte array
[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

◆ VoiceSdkSpeechSummaryStreamAddFloatSamples()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamAddFloatSamples ( const VoiceSdkSpeechSummaryStream stream,
const float *  float_samples,
size_t  samples_num,
char **  error_msg 
)

Adds input samples to the stream and recalculates speech/background lengths and speech events.

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[in]float_samplespointer to floats array containing PCM16 audio samples
[in]samples_numsize of the floats array
[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

◆ VoiceSdkSpeechSummaryStreamAddPcm16Samples()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamAddPcm16Samples ( const VoiceSdkSpeechSummaryStream stream,
const int16_t *  pcm16_samples,
size_t  samples_num,
char **  error_msg 
)

Adds input samples to the stream and recalculates speech/background lengths and speech events.

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[in]pcm16_samplespointer to shorts array containing PCM16 audio samples
[in]samples_numsize of the shorts array
[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

◆ VoiceSdkSpeechSummaryStreamCreate()

VOICE_SDK_API VoiceSdkSpeechSummaryStream* VoiceSdkSpeechSummaryStreamCreate ( const VoiceSdkSpeechSummaryEngine engine,
size_t  sample_rate,
char **  error_msg 
)

Creates new instance of VoiceSdkSpeechSummaryStream from the VoiceSdkSpeechSummaryEngine.

The returned value is used for any subsequent VoiceSdkSpeechSummaryStream* calls. The stream must be released by calling VoiceSdkSpeechSummaryStreamRelease after it is no longer needed.

Note that VoiceSdkSpeechSummary instances returned by VoiceSdkSpeechSummaryStreamGetTotalSpeechSummary calls remain valid after corresponding VoiceSdkSpeechSummaryStream is released and can be used separately.

Parameters
[in]engineinstance of Speech Summary engine that was created previously.
[in]sample_ratesample rate of audio stream
[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
VoiceSdkSpeechSummaryStream* newly created instance of Speech Summary Stream or NULL in case of any errors
See also
VoiceSdkSpeechSummaryStreamRelease

◆ VoiceSdkSpeechSummaryStreamFinalize()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamFinalize ( const VoiceSdkSpeechSummaryStream stream,
char **  error_msg 
)

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

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[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

◆ VoiceSdkSpeechSummaryStreamGetCurrentBackgroundLength()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamGetCurrentBackgroundLength ( const VoiceSdkSpeechSummaryStream stream,
float *  result,
char **  error_msg 
)

Returns current background length (length of a continuous non-speech segment starting on the last detected speech frame).

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[out]resultresulting background length in milliseconds, 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

◆ VoiceSdkSpeechSummaryStreamGetSpeechEvent()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamGetSpeechEvent ( const VoiceSdkSpeechSummaryStream stream,
VoiceSdkSpeechEvent result,
char **  error_msg 
)

Retrieves pending speech event from the stream. Only use this if VoiceSdkSpeechSummaryStreamHasSpeechEvents returns true.

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[out]resultresulting speech event, 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

◆ VoiceSdkSpeechSummaryStreamGetTotalSpeechInfo()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamGetTotalSpeechInfo ( const VoiceSdkSpeechSummaryStream stream,
VoiceSdkSpeechInfo result,
char **  error_msg 
)

Retrieves total accumulated speech info.

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[out]resultresulting speech info, 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

◆ VoiceSdkSpeechSummaryStreamGetTotalSpeechSummary()

VOICE_SDK_API VoiceSdkSpeechSummary* VoiceSdkSpeechSummaryStreamGetTotalSpeechSummary ( const VoiceSdkSpeechSummaryStream stream,
char **  error_msg 
)

Retrieves total speech summary, that is, over all added samples, from the stream. The returned Speech Summary needs to be cleaned up manually.

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[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
VoiceSdkSpeechSummary* speech summary for all added audio or NULL in case of any errors

◆ VoiceSdkSpeechSummaryStreamHasSpeechEvents()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamHasSpeechEvents ( const VoiceSdkSpeechSummaryStream stream,
bool *  result,
char **  error_msg 
)

Check whether or not the stream has any pending speech events to be consumed.

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[out]resultresult of the check, true if the stream has events, false otherwise
[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

◆ VoiceSdkSpeechSummaryStreamOpusAddPacket()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusAddPacket ( const VoiceSdkSpeechSummaryStreamOpus stream,
const uint8_t *  bytes,
size_t  bytes_num,
char **  error_msg 
)

Adds Opus packet to process.

Parameters
[in]streaminstance of Speech Summary Stream Opus created with VoiceSdkSpeechSummaryStreamOpusCreate
[in]bytesa buffer containing single Opus packet. It is expected that packet contains data for single mono stream
[in]bytes_numsize of the byte array
[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

◆ VoiceSdkSpeechSummaryStreamOpusCreate()

VOICE_SDK_API VoiceSdkSpeechSummaryStreamOpus* VoiceSdkSpeechSummaryStreamOpusCreate ( const char *  init_data_path,
size_t  sample_rate,
char **  error_msg 
)

Creates new instance of VoiceSdkSpeechSummaryStreamOpus from the initialization data.

The returned value is used for any subsequent VoiceSdkSpeechSummaryStreamOpus* calls. The stream must be released by calling VoiceSdkSpeechSummaryStreamOpusRelease after it is no longer needed.

Note that VoiceSdkSpeechSummary instances returned by VoiceSdkSpeechSummaryStreamOpusGetTotalSpeechSummary calls remain valid after corresponding VoiceSdkSpeechSummaryStreamOpus is released and can be used separately.

Parameters
[in]init_data_pathfilesystem path for the initialization data folder
[in]sample_ratesample rate of audio stream
[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
VoiceSdkSpeechSummaryStreamOpus* newly created instance of Opus Speech Summary Stream or NULL in case of any errors
See also
VoiceSdkSpeechSummaryStreamOpusRelease

◆ VoiceSdkSpeechSummaryStreamOpusFinalize()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusFinalize ( const VoiceSdkSpeechSummaryStreamOpus stream,
char **  error_msg 
)

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

Parameters
[in]streaminstance of Speech Summary Stream Opus created with VoiceSdkSpeechSummaryStreamOpusCreate
[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

◆ VoiceSdkSpeechSummaryStreamOpusGetCurrentBackgroundLength()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusGetCurrentBackgroundLength ( const VoiceSdkSpeechSummaryStreamOpus stream,
float *  result,
char **  error_msg 
)

Returns current background length (length of a continuous non-speech segment starting on the last detected speech frame).

Parameters
[in]streaminstance of Speech Summary Stream Opus created with VoiceSdkSpeechSummaryStreamOpusCreate
[out]resultresulting background length in milliseconds, 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

◆ VoiceSdkSpeechSummaryStreamOpusGetSpeechEvent()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusGetSpeechEvent ( const VoiceSdkSpeechSummaryStreamOpus stream,
VoiceSdkSpeechEvent result,
char **  error_msg 
)

Retrieves pending speech event from the stream. Only use this if VoiceSdkSpeechSummaryStreamOpusHasSpeechEvents returns true.

Parameters
[in]streaminstance of Speech Summary Stream Opus created with VoiceSdkSpeechSummaryStreamOpusCreate
[out]resultresulting speech event, 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

◆ VoiceSdkSpeechSummaryStreamOpusGetTotalSpeechInfo()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusGetTotalSpeechInfo ( const VoiceSdkSpeechSummaryStreamOpus stream,
VoiceSdkSpeechInfo result,
char **  error_msg 
)

Retrieves total accumulated speech info.

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[out]resultresulting speech info, 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

◆ VoiceSdkSpeechSummaryStreamOpusGetTotalSpeechSummary()

VOICE_SDK_API VoiceSdkSpeechSummary* VoiceSdkSpeechSummaryStreamOpusGetTotalSpeechSummary ( const VoiceSdkSpeechSummaryStreamOpus stream,
char **  error_msg 
)

Retrieves total speech summary, that is, over all added samples, from the stream. The returned Speech Summary needs to be cleaned up manually.

Parameters
[in]streaminstance of Speech Summary Stream Opus created with VoiceSdkSpeechSummaryStreamOpusCreate
[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
VoiceSdkSpeechSummary* speech summary for all added audio or NULL in case of any errors

◆ VoiceSdkSpeechSummaryStreamOpusHasSpeechEvents()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusHasSpeechEvents ( const VoiceSdkSpeechSummaryStreamOpus stream,
bool *  result,
char **  error_msg 
)

Check whether or not the stream has any pending speech events to be consumed.

Parameters
[in]streaminstance of Speech Summary Stream Opus created with VoiceSdkSpeechSummaryStreamOpusCreate
[out]resultresult of the check, true if the stream has events, false otherwise
[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

◆ VoiceSdkSpeechSummaryStreamOpusRelease()

VOICE_SDK_API void VoiceSdkSpeechSummaryStreamOpusRelease ( VoiceSdkSpeechSummaryStreamOpus stream)

Releases all memory allocated for this VoiceSdkSpeechSummaryStreamOpus instance.

Parameters
streaminstance of VoiceSdkSpeechSummaryStreamOpus that needs freeing

◆ VoiceSdkSpeechSummaryStreamOpusReset()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusReset ( const VoiceSdkSpeechSummaryStreamOpus stream,
char **  error_msg 
)

Resets the stream, cleaning up internal state, any leftover internal buffers and pending events.

Parameters
[in]streaminstance of Speech Summary Stream Opus created with VoiceSdkSpeechSummaryStreamOpusCreate
[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

◆ VoiceSdkSpeechSummaryStreamRelease()

VOICE_SDK_API void VoiceSdkSpeechSummaryStreamRelease ( VoiceSdkSpeechSummaryStream stream)

Releases all memory allocated for this VoiceSdkSpeechSummaryStream instance.

Parameters
streaminstance of VoiceSdkSpeechSummaryStream that needs freeing

◆ VoiceSdkSpeechSummaryStreamReset()

VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamReset ( const VoiceSdkSpeechSummaryStream stream,
char **  error_msg 
)

Resets the stream, cleaning up internal state, any leftover internal buffers and pending events.

Parameters
[in]streaminstance of Speech Summary Stream created with VoiceSdkSpeechSummaryStreamCreate
[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