VoiceSDK  5.2.1
media_c_api.h
Go to the documentation of this file.
1 /* Copyright 2021 ID R&D Inc. All Rights Reserved. */
2 
3 #pragma once
4 
5 #include <stdint.h>
6 #include <stddef.h>
7 
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 // forward declarations
22 
23 // api objects
24 typedef struct VoiceSdkSpeechEvent {
28  bool is_voice;
29 
35 
36 typedef struct VoiceSdkSpeechInfo {
41 
46 
52 
53 DECL_TYPED_ARRAY(VoiceSdkSpeechEventArray, VoiceSdkSpeechEvent)
54 DECL_TYPED_ARRAY(VoiceSdkSpeechInfoArray, VoiceSdkSpeechInfo)
55 
56 typedef struct VoiceSdkSpeechSummary {
60  VoiceSdkSpeechEventArray speech_events;
61 
67 
73 
78 
83 
88 
94 
100 
105 
110 
115 
121 
127 
132 
137 
143 
149 
153  float snr_db;
154 
159 
164 
170 
171 /************************
172  * Speech Summary calls *
173  ************************/
174 
193 VoiceSdkSpeechSummaryEngine* VoiceSdkSpeechSummaryEngineCreate(const char* init_data_path, char** error_msg);
194 
210  const uint8_t* bytes, size_t bytes_num,
211  size_t sample_rate, char** error_msg);
212 
228  const VoiceSdkSpeechSummaryEngine* engine, const int16_t* pcm16_samples, size_t samples_num, size_t sample_rate,
229  char** error_msg);
230 
247  const VoiceSdkSpeechSummaryEngine* engine, const float* float_samples, size_t samples_num, size_t sample_rate,
248  char** error_msg);
249 
263  const char* audio_path, char** error_msg);
264 
272 
273 
285 
286 
287 /*******************************
288  * SpeechSummaryStream calls *
289  *******************************/
290 
311  size_t sample_rate, char** error_msg);
312 
325 bool VoiceSdkSpeechSummaryStreamAddByteSamples(const VoiceSdkSpeechSummaryStream* stream, const uint8_t* bytes,
326  size_t bytes_num, char** error_msg);
327 
340 bool VoiceSdkSpeechSummaryStreamAddPcm16Samples(const VoiceSdkSpeechSummaryStream* stream, const int16_t* pcm16_samples,
341  size_t samples_num, char** error_msg);
342 
355 bool VoiceSdkSpeechSummaryStreamAddFloatSamples(const VoiceSdkSpeechSummaryStream* stream, const float* float_samples,
356  size_t samples_num, char** error_msg);
357 
358 
372  char** error_msg);
386  char** error_msg);
387 
401  char** error_msg);
402 
415  char** error_msg);
416 
429  VoiceSdkSpeechInfo* result, char** error_msg);
430 
442 bool VoiceSdkSpeechSummaryStreamReset(const VoiceSdkSpeechSummaryStream* stream, char** error_msg);
443 
455 bool VoiceSdkSpeechSummaryStreamFinalize(const VoiceSdkSpeechSummaryStream* stream, char** error_msg);
456 
464 
465 /***********************************
466  * SpeechSummaryStreamOpus calls *
467  ***********************************/
468 
489 VoiceSdkSpeechSummaryStreamOpus* VoiceSdkSpeechSummaryStreamOpusCreate(const char* init_data_path, size_t sample_rate,
490  char** error_msg);
491 
505 bool VoiceSdkSpeechSummaryStreamOpusAddPacket(const VoiceSdkSpeechSummaryStreamOpus* stream, const uint8_t* bytes,
506  size_t bytes_num, char** error_msg);
507 
522  float* result, char** error_msg);
537  char** error_msg);
538 
553  VoiceSdkSpeechEvent* result, char** error_msg);
554 
568  const VoiceSdkSpeechSummaryStreamOpus* stream, char** error_msg);
569 
582  VoiceSdkSpeechInfo* result, char** error_msg);
583 
595 bool VoiceSdkSpeechSummaryStreamOpusReset(const VoiceSdkSpeechSummaryStreamOpus* stream, char** error_msg);
596 
609 
617 
618 /************************
619  * SNR Computer calls *
620  ************************/
621 
638 VoiceSdkSnrComputer* VoiceSdkSnrComputerCreate(const char* init_data_path, char** error_msg);
639 
654 bool VoiceSdkSnrComputerComputeFromBytes(const VoiceSdkSnrComputer* engine, const uint8_t* bytes, size_t bytes_num,
655  size_t sample_rate, float* result, char** error_msg);
656 
671 bool VoiceSdkSnrComputerComputeFromPcm16Samples(const VoiceSdkSnrComputer* engine, const int16_t* pcm16_samples,
672  size_t samples_num, size_t sample_rate, float* result,
673  char** error_msg);
674 
690 bool VoiceSdkSnrComputerComputeFromFloatSamples(const VoiceSdkSnrComputer* engine, const float* float_samples,
691  size_t samples_num, size_t sample_rate, float* result,
692  char** error_msg);
693 
705 bool VoiceSdkSnrComputerComputeFromFile(const VoiceSdkSnrComputer* engine, const char* audio_path, float* result,
706  char** error_msg);
707 
715 
716 /********************************
717  * SpeechEndpointDetector calls *
718  ********************************/
719 
738  size_t max_silence_length_ms, size_t sample_rate,
739  char** error_msg);
740 
753 bool VoiceSdkSpeechEndpointDetectorAddByteSamples(const VoiceSdkSpeechEndpointDetector* detector, const uint8_t* bytes,
754  size_t bytes_num, char** error_msg);
755 
770  const int16_t* pcm16_samples, size_t samples_num, char** error_msg);
771 
786  const float* float_samples, size_t samples_num, char** error_msg);
787 
800  char** error_msg);
801 
813 bool VoiceSdkSpeechEndpointDetectorReset(const VoiceSdkSpeechEndpointDetector* detector, char** error_msg);
814 
822 
823 /************************************
824  * SpeechEndpointDetectorOpus calls *
825  ************************************/
826 
845  size_t max_silence_length_ms,
846  size_t sample_rate, char** error_msg);
847 
862  const uint8_t* bytes, size_t bytes_num, char** error_msg);
876  char** error_msg);
877 
891 
899 
900 /************************************
901  * VoiceSdkQualityCheckEngine calls *
902  ************************************/
903 
921 VoiceSdkQualityCheckEngine* VoiceSdkQualityCheckEngineCreate(const char* init_data_path, VoiceSdkErrorCode* error_code,
922  char** error_msg);
923 
942  VoiceSdkErrorCode* error_code, char** error_msg);
943 
956  const VoiceSdkQualityCheckEngine* engine, const char* audio_path,
957  VoiceSdkQualityCheckMetricsThresholds thresholds, VoiceSdkErrorCode* error_code, char** error_msg);
958 
973  const VoiceSdkQualityCheckEngine* engine, const float* float_samples, size_t num_samples, size_t sample_rate,
974  VoiceSdkQualityCheckMetricsThresholds thresholds, VoiceSdkErrorCode* error_code, char** error_msg);
975 
990  const VoiceSdkQualityCheckEngine* engine, const int16_t* samples, size_t num_samples, size_t sample_rate,
991  VoiceSdkQualityCheckMetricsThresholds thresholds, VoiceSdkErrorCode* error_code, char** error_msg);
992 
1007  const VoiceSdkQualityCheckEngine* engine, const uint8_t* bytes, size_t num_bytes, size_t sample_rate,
1008  VoiceSdkQualityCheckMetricsThresholds thresholds, VoiceSdkErrorCode* error_code, char** error_msg);
1009 
1016 
1023 
1024 #ifdef __cplusplus
1025 }
1026 #endif
VoiceSdkQualityCheckEngineResult
Definition: media_c_api.h:144
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.
VoiceSdkQualityCheckMetricsThresholds
Definition: media_c_api.h:122
VoiceSdkSpeechEndpointDetectorOpusRelease
VOICE_SDK_API void VoiceSdkSpeechEndpointDetectorOpusRelease(VoiceSdkSpeechEndpointDetectorOpus *detector)
Releases all memory allocated for this VoiceSdkSpeechEndpointDetectorOpus instance.
VoiceSdkErrorCode
VoiceSdkErrorCode
Enumeration of the error codes which can be returned from the VoiceSDK API.
Definition: core_c_api.h:18
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.
kVoiceSdkQualityCheckShortDescriptionTooSmallSpeechRelativeLength
@ kVoiceSdkQualityCheckShortDescriptionTooSmallSpeechRelativeLength
Speech relative length (speech length relative to the total audio length) is too small.
Definition: media_c_api.h:87
kVoiceSdkQualityCheckScenarioLiveness
@ kVoiceSdkQualityCheckScenarioLiveness
Liveness check.
Definition: media_c_api.h:119
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...
VoiceSdkSpeechSummaryStream
struct VoiceSdkSpeechSummaryStream VoiceSdkSpeechSummaryStream
Definition: media_c_api.h:16
VoiceSdkSpeechSummaryEngine
struct VoiceSdkSpeechSummaryEngine VoiceSdkSpeechSummaryEngine
Definition: media_c_api.h:15
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.
VoiceSdkSpeechSummaryEngineRelease
VOICE_SDK_API void VoiceSdkSpeechSummaryEngineRelease(VoiceSdkSpeechSummaryEngine *engine)
Releases all memory allocated for this VoiceSdkSpeechSummaryEngine instance.
VoiceSdkQualityCheckEngineResult::speech_relative_length
float speech_relative_length
Speech relative length (speech length relative to the total audio length) metric value obtained on qu...
Definition: media_c_api.h:163
VoiceSdkSpeechEvent
Definition: media_c_api.h:24
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.
VoiceSdkSnrComputerRelease
VOICE_SDK_API void VoiceSdkSnrComputerRelease(VoiceSdkSnrComputer *engine)
Releases all memory allocated for this VoiceSdkSnrComputer instance.
VoiceSdkSnrComputerCreate
VOICE_SDK_API VoiceSdkSnrComputer * VoiceSdkSnrComputerCreate(const char *init_data_path, char **error_msg)
Creates new SNR Computer instance.
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.
VoiceSdkSpeechSummaryStreamOpusGetTotalSpeechInfo
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusGetTotalSpeechInfo(const VoiceSdkSpeechSummaryStreamOpus *stream, VoiceSdkSpeechInfo *result, char **error_msg)
Retrieves total accumulated speech info.
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.
VoiceSdkSpeechInfo
Definition: media_c_api.h:36
VoiceSdkQualityCheckMetricsThresholds::maximum_multiple_speakers_detector_score
float maximum_multiple_speakers_detector_score
Maximum multiple speakers detector score allowed to pass quality check.
Definition: media_c_api.h:141
VoiceSdkQualityCheckEngine
struct VoiceSdkQualityCheckEngine VoiceSdkQualityCheckEngine
Definition: media_c_api.h:21
kVoiceSdkQualityCheckScenarioVerifyTiEnrollment
@ kVoiceSdkQualityCheckScenarioVerifyTiEnrollment
Verification, TI enrollment step.
Definition: media_c_api.h:99
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.
VoiceSdkSpeechEvent
struct VoiceSdkSpeechEvent VoiceSdkSpeechEvent
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.
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.
VoiceSdkAudioInterval
Definition: core_c_api.h:93
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 det...
VoiceSdkQualityCheckShortDescription
VoiceSdkQualityCheckShortDescription
Definition: media_c_api.h:68
VOICE_SDK_API
#define VOICE_SDK_API
Definition: config.h:21
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.
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.
kVoiceSdkQualityCheckShortDescriptionMultipleSpeakersDetected
@ kVoiceSdkQualityCheckShortDescriptionMultipleSpeakersDetected
Multiple speakers detected.
Definition: media_c_api.h:92
VoiceSdkSpeechSummary
Definition: media_c_api.h:56
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.
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.
VoiceSdkSpeechSummaryStreamGetTotalSpeechInfo
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamGetTotalSpeechInfo(const VoiceSdkSpeechSummaryStream *stream, VoiceSdkSpeechInfo *result, char **error_msg)
Retrieves total accumulated speech info.
VoiceSdkSpeechEvent::audio_interval
VoiceSdkAudioInterval audio_interval
Speech event audio interval.
Definition: media_c_api.h:33
VoiceSdkSpeechEndpointDetectorIsSpeechEnded
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorIsSpeechEnded(const VoiceSdkSpeechEndpointDetector *detector, bool *result, char **error_msg)
Returns detection state.
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 VoiceSdkSpeechSummaryStreamHasSpeech...
VoiceSdkSpeechInfo::background_length_ms
float background_length_ms
Non-speech signal length in milliseconds.
Definition: media_c_api.h:45
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,...
VoiceSdkSpeechSummaryStreamOpusRelease
VOICE_SDK_API void VoiceSdkSpeechSummaryStreamOpusRelease(VoiceSdkSpeechSummaryStreamOpus *stream)
Releases all memory allocated for this VoiceSdkSpeechSummaryStreamOpus instance.
VoiceSdkSpeechEndpointDetectorRelease
VOICE_SDK_API void VoiceSdkSpeechEndpointDetectorRelease(VoiceSdkSpeechEndpointDetector *detector)
Releases all memory allocated for this VoiceSdkSpeechEndpointDetector instance.
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 m...
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.
VoiceSdkSpeechEvent::is_voice
bool is_voice
Whether the interval contains speech or not.
Definition: media_c_api.h:28
VoiceSdkSpeechEndpointDetectorOpusIsSpeechEnded
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusIsSpeechEnded(const VoiceSdkSpeechEndpointDetectorOpus *detector, bool *result, char **error_msg)
Returns detection state.
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...
kVoiceSdkQualityCheckScenarioVerifyTiVerification
@ kVoiceSdkQualityCheckScenarioVerifyTiVerification
Verification, TI verification step.
Definition: media_c_api.h:104
VoiceSdkQualityCheckEngineResult
struct VoiceSdkQualityCheckEngineResult VoiceSdkQualityCheckEngineResult
VoiceSdkSnrComputer
struct VoiceSdkSnrComputer VoiceSdkSnrComputer
Definition: media_c_api.h:18
VoiceSdkQualityCheckEngineRelease
VOICE_SDK_API void VoiceSdkQualityCheckEngineRelease(VoiceSdkQualityCheckEngine *engine)
Releases all memory allocated for this VoiceSdkQualityCheckEngine instance.
core_c_api.h
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.
VoiceSdkQualityCheckMetricsThresholds::minimum_snr_db
float minimum_snr_db
Minimum signal-to-noise ratio required to pass quality check in dB.
Definition: media_c_api.h:126
VoiceSdkQualityCheckEngineResult::snr_db
float snr_db
SNR metric value obtained on quality check in Db.
Definition: media_c_api.h:153
VoiceSdkSpeechEndpointDetectorOpus
struct VoiceSdkSpeechEndpointDetectorOpus VoiceSdkSpeechEndpointDetectorOpus
Definition: media_c_api.h:20
kVoiceSdkQualityCheckShortDescriptionTooNoisy
@ kVoiceSdkQualityCheckShortDescriptionTooNoisy
Audio is too noisy.
Definition: media_c_api.h:72
VoiceSdkQualityCheckEngineResult::multiple_speakers_detector_score
float multiple_speakers_detector_score
Multiple speakers detector score value obtained on quality check.
Definition: media_c_api.h:168
VoiceSdkSpeechSummaryStreamCreate
VOICE_SDK_API VoiceSdkSpeechSummaryStream * VoiceSdkSpeechSummaryStreamCreate(const VoiceSdkSpeechSummaryEngine *engine, size_t sample_rate, char **error_msg)
Creates new instance of VoiceSdkSpeechSummaryStream from the VoiceSdkSpeechSummaryEngine.
kVoiceSdkQualityCheckShortDescriptionTooSmallSpeechLength
@ kVoiceSdkQualityCheckShortDescriptionTooSmallSpeechLength
Speech length in the audio is too small.
Definition: media_c_api.h:77
VoiceSdkSpeechSummaryStreamRelease
VOICE_SDK_API void VoiceSdkSpeechSummaryStreamRelease(VoiceSdkSpeechSummaryStream *stream)
Releases all memory allocated for this VoiceSdkSpeechSummaryStream instance.
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.
DECL_TYPED_ARRAY
#define DECL_TYPED_ARRAY(name, type)
Definition: core_c_api.h:26
VoiceSdkSpeechInfo::speech_length_ms
float speech_length_ms
Speech signal length in milliseconds.
Definition: media_c_api.h:40
VoiceSdkQualityCheckEngineCreate
VOICE_SDK_API VoiceSdkQualityCheckEngine * VoiceSdkQualityCheckEngineCreate(const char *init_data_path, VoiceSdkErrorCode *error_code, char **error_msg)
Creates new Quality check engine instance.
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.
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 VoiceSdkSpeechSummaryStreamOpusHasSp...
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.
VoiceSdkSpeechSummaryStreamOpus
struct VoiceSdkSpeechSummaryStreamOpus VoiceSdkSpeechSummaryStreamOpus
Definition: media_c_api.h:17
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.
VoiceSdkQualityCheckMetricsThresholds
struct VoiceSdkQualityCheckMetricsThresholds VoiceSdkQualityCheckMetricsThresholds
VoiceSdkSpeechSummary::speech_events
VoiceSdkSpeechEventArray speech_events
Contains audio intervals marked as speech or non-speech.
Definition: media_c_api.h:60
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.
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,...
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.
kVoiceSdkQualityCheckScenarioVerifyTdEnrollment
@ kVoiceSdkQualityCheckScenarioVerifyTdEnrollment
Verification, TD enrollment step.
Definition: media_c_api.h:109
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.
kVoiceSdkQualityCheckShortDescriptionOk
@ kVoiceSdkQualityCheckShortDescriptionOk
Audio successfully passed quality check.
Definition: media_c_api.h:82
VoiceSdkQualityCheckMetricsThresholds::minimum_speech_length_ms
float minimum_speech_length_ms
Minimum speech length required to pass quality check in milliseconds.
Definition: media_c_api.h:131
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.
VoiceSdkSpeechEndpointDetector
struct VoiceSdkSpeechEndpointDetector VoiceSdkSpeechEndpointDetector
Definition: media_c_api.h:19
VoiceSdkQualityCheckMetricsThresholds::minimum_speech_relative_length
float minimum_speech_relative_length
Minimum speech relative length (speech length relative to the total audio length) required to pass qu...
Definition: media_c_api.h:136
VoiceSdkSpeechSummaryRelease
VOICE_SDK_API void VoiceSdkSpeechSummaryRelease(VoiceSdkSpeechSummary *summary)
Releases all memory allocated for this VoiceSdkSpeechSummary instance. This includes all nested struc...
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 Su...
VoiceSdkQualityCheckEngineResult::speech_length_ms
float speech_length_ms
Speech length metric value obtained on quality check in milliseconds.
Definition: media_c_api.h:158
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.
VoiceSdkSpeechEndpointDetectorReset
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorReset(const VoiceSdkSpeechEndpointDetector *detector, char **error_msg)
Resets detector state.
VoiceSdkQualityCheckEngineResult::quality_check_short_description
VoiceSdkQualityCheckShortDescription quality_check_short_description
Short description of the quality check results.
Definition: media_c_api.h:148
VoiceSdkSpeechInfo
struct VoiceSdkSpeechInfo VoiceSdkSpeechInfo
VoiceSdkQualityCheckScenario
VoiceSdkQualityCheckScenario
Definition: media_c_api.h:95
VoiceSdkSpeechSummary::speech_info
VoiceSdkSpeechInfo speech_info
Contains speech statistics.
Definition: media_c_api.h:65
VoiceSdkSpeechEndpointDetectorOpusReset
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusReset(const VoiceSdkSpeechEndpointDetectorOpus *detector, char **error_msg)
Resets detector state.
VoiceSdkSpeechSummary
struct VoiceSdkSpeechSummary VoiceSdkSpeechSummary
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 det...
kVoiceSdkQualityCheckScenarioVerifyTdVerification
@ kVoiceSdkQualityCheckScenarioVerifyTdVerification
Verification, TD verification step.
Definition: media_c_api.h:114
VoiceSdkQualityCheckEngineResultRelease
VOICE_SDK_API void VoiceSdkQualityCheckEngineResultRelease(VoiceSdkQualityCheckEngineResult *check_result)
Releases VoiceSdkQualityCheckEngineResult.
VoiceSdkSpeechInfo::total_length_ms
float total_length_ms
Processed audio total length (totalLengthMs = speechLengthMs + backgroundLengthMs) in milliseconds.
Definition: media_c_api.h:50
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.
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.
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....