VoiceSDK  5.0.2
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
VoiceSdkErrorCode
Enumeration of the error codes which can be returned from the VoiceSDK API.
Definition: core_c_api.h:18
Speech length in the audio is too small.
Definition: media_c_api.h:77
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.
VOICE_SDK_API void VoiceSdkSpeechSummaryEngineRelease(VoiceSdkSpeechSummaryEngine *engine)
Releases all memory allocated for this VoiceSdkSpeechSummaryEngine instance.
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...
Verification, TI verification step.
Definition: media_c_api.h:104
float snr_db
SNR metric value obtained on quality check in Db.
Definition: media_c_api.h:153
float speech_length_ms
Speech length metric value obtained on quality check in milliseconds.
Definition: media_c_api.h:158
struct VoiceSdkSpeechEvent VoiceSdkSpeechEvent
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...
VOICE_SDK_API VoiceSdkSpeechSummaryEngine * VoiceSdkSpeechSummaryEngineCreate(const char *init_data_path, char **error_msg)
Creates new instance of VoiceSdkSpeechSummaryEngine from the provided initialization data path...
struct VoiceSdkSpeechSummaryStream VoiceSdkSpeechSummaryStream
Definition: media_c_api.h:16
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.
Verification, TD verification step.
Definition: media_c_api.h:114
VOICE_SDK_API VoiceSdkSnrComputer * VoiceSdkSnrComputerCreate(const char *init_data_path, char **error_msg)
Creates new SNR Computer instance.
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
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...
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusGetTotalSpeechInfo(const VoiceSdkSpeechSummaryStreamOpus *stream, VoiceSdkSpeechInfo *result, char **error_msg)
Retrieves total accumulated speech info.
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...
Definition: media_c_api.h:144
struct VoiceSdkSpeechSummaryEngine VoiceSdkSpeechSummaryEngine
Definition: media_c_api.h:15
Definition: media_c_api.h:36
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...
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...
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...
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...
Definition: media_c_api.h:122
VOICE_SDK_API void VoiceSdkSnrComputerRelease(VoiceSdkSnrComputer *engine)
Releases all memory allocated for this VoiceSdkSnrComputer instance.
struct VoiceSdkSpeechSummary VoiceSdkSpeechSummary
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.
struct VoiceSdkQualityCheckEngine VoiceSdkQualityCheckEngine
Definition: media_c_api.h:21
bool is_voice
Whether the interval contains speech or not.
Definition: media_c_api.h:28
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.
struct VoiceSdkQualityCheckMetricsThresholds VoiceSdkQualityCheckMetricsThresholds
Audio successfully passed quality check.
Definition: media_c_api.h:82
float minimum_snr_db
Minimum signal-to-noise ratio required to pass quality check in dB.
Definition: media_c_api.h:126
VoiceSdkQualityCheckShortDescription quality_check_short_description
Short description of the quality check results.
Definition: media_c_api.h:148
struct VoiceSdkSpeechInfo VoiceSdkSpeechInfo
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.
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusIsSpeechEnded(const VoiceSdkSpeechEndpointDetectorOpus *detector, bool *result, char **error_msg)
Returns detection state.
float minimum_speech_length_ms
Minimum speech length required to pass quality check in milliseconds.
Definition: media_c_api.h:131
struct VoiceSdkQualityCheckEngineResult VoiceSdkQualityCheckEngineResult
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...
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorIsSpeechEnded(const VoiceSdkSpeechEndpointDetector *detector, bool *result, char **error_msg)
Returns detection state.
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.
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.
VoiceSdkQualityCheckShortDescription
Definition: media_c_api.h:68
VOICE_SDK_API VoiceSdkQualityCheckEngine * VoiceSdkQualityCheckEngineCreate(const char *init_data_path, VoiceSdkErrorCode *error_code, char **error_msg)
Creates new Quality check engine instance.
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.
VOICE_SDK_API void VoiceSdkSpeechSummaryStreamOpusRelease(VoiceSdkSpeechSummaryStreamOpus *stream)
Releases all memory allocated for this VoiceSdkSpeechSummaryStreamOpus instance.
Verification, TI enrollment step.
Definition: media_c_api.h:99
VoiceSdkAudioInterval audio_interval
Speech event audio interval.
Definition: media_c_api.h:33
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&#39;s possible...
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.
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamGetTotalSpeechInfo(const VoiceSdkSpeechSummaryStream *stream, VoiceSdkSpeechInfo *result, char **error_msg)
Retrieves total accumulated speech info.
struct VoiceSdkSnrComputer VoiceSdkSnrComputer
Definition: media_c_api.h:18
VOICE_SDK_API void VoiceSdkQualityCheckEngineRelease(VoiceSdkQualityCheckEngine *engine)
Releases all memory allocated for this VoiceSdkQualityCheckEngine instance.
struct VoiceSdkSpeechEndpointDetectorOpus VoiceSdkSpeechEndpointDetectorOpus
Definition: media_c_api.h:20
VOICE_SDK_API void VoiceSdkSpeechEndpointDetectorRelease(VoiceSdkSpeechEndpointDetector *detector)
Releases all memory allocated for this VoiceSdkSpeechEndpointDetector instance.
VOICE_SDK_API void VoiceSdkSpeechSummaryRelease(VoiceSdkSpeechSummary *summary)
Releases all memory allocated for this VoiceSdkSpeechSummary instance. This includes all nested struc...
VOICE_SDK_API VoiceSdkSpeechSummaryStream * VoiceSdkSpeechSummaryStreamCreate(const VoiceSdkSpeechSummaryEngine *engine, size_t sample_rate, char **error_msg)
Creates new instance of VoiceSdkSpeechSummaryStream from the VoiceSdkSpeechSummaryEngine.
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&#39;s possible...
VoiceSdkSpeechEventArray speech_events
Contains audio intervals marked as speech or non-speech.
Definition: media_c_api.h:60
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...
Speech relative length (speech length relative to the total audio length) is too small.
Definition: media_c_api.h:87
struct VoiceSdkSpeechEndpointDetector VoiceSdkSpeechEndpointDetector
Definition: media_c_api.h:19
#define VOICE_SDK_API
Definition: config.h:21
Definition: media_c_api.h:56
float speech_length_ms
Speech signal length in milliseconds.
Definition: media_c_api.h:40
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...
VOICE_SDK_API void VoiceSdkSpeechSummaryStreamRelease(VoiceSdkSpeechSummaryStream *stream)
Releases all memory allocated for this VoiceSdkSpeechSummaryStream instance.
Definition: media_c_api.h:24
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...
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.
struct VoiceSdkSpeechSummaryStreamOpus VoiceSdkSpeechSummaryStreamOpus
Definition: media_c_api.h:17
VoiceSdkQualityCheckScenario
Definition: media_c_api.h:95
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...
VOICE_SDK_API void VoiceSdkQualityCheckEngineResultRelease(VoiceSdkQualityCheckEngineResult *check_result)
Releases VoiceSdkQualityCheckEngineResult.
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...
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.
Multiple speakers detected.
Definition: media_c_api.h:92
Liveness check.
Definition: media_c_api.h:119
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorReset(const VoiceSdkSpeechEndpointDetector *detector, char **error_msg)
Resets detector state.
Definition: core_c_api.h:93
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.
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...
float total_length_ms
Processed audio total length (totalLengthMs = speechLengthMs + backgroundLengthMs) in milliseconds...
Definition: media_c_api.h:50
VoiceSdkSpeechInfo speech_info
Contains speech statistics.
Definition: media_c_api.h:65
#define DECL_TYPED_ARRAY(name, type)
Definition: core_c_api.h:26
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
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...
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...
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...
float multiple_speakers_detector_score
Multiple speakers detector score value obtained on quality check.
Definition: media_c_api.h:168
Audio is too noisy.
Definition: media_c_api.h:72
VOICE_SDK_API void VoiceSdkSpeechEndpointDetectorOpusRelease(VoiceSdkSpeechEndpointDetectorOpus *detector)
Releases all memory allocated for this VoiceSdkSpeechEndpointDetectorOpus instance.
VOICE_SDK_API bool VoiceSdkSpeechSummaryStreamOpusAddPacket(const VoiceSdkSpeechSummaryStreamOpus *stream, const uint8_t *bytes, size_t bytes_num, char **error_msg)
Adds Opus packet to process.
float background_length_ms
Non-speech signal length in milliseconds.
Definition: media_c_api.h:45
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusAddPacket(const VoiceSdkSpeechEndpointDetectorOpus *detector, const uint8_t *bytes, size_t bytes_num, char **error_msg)
Adds Opus packet to process.
float maximum_multiple_speakers_detector_score
Maximum multiple speakers detector score allowed to pass quality check.
Definition: media_c_api.h:141
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...
VOICE_SDK_API bool VoiceSdkSpeechEndpointDetectorOpusReset(const VoiceSdkSpeechEndpointDetectorOpus *detector, char **error_msg)
Resets detector state.
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...
Verification, TD enrollment step.
Definition: media_c_api.h:109