5 #include <voicesdk/core/config.h>
10 #include <unordered_map>
76 std::string short_description_str;
80 short_description_str =
"kTooNoisy";
83 short_description_str =
"kTooSmallSpeechLength";
86 short_description_str =
"kOk";
89 short_description_str =
"kTooSmallSpeechRelativeLength";
92 short_description_str =
"kMultipleSpeakersDetected";
96 os <<
"QualityCheckEngineResult["
97 <<
"snr_db: " << obj.
snr_db <<
", "
101 <<
"quality_check_short_description: " << short_description_str
142 enum class QualityCheckScenario: uint8_t {
146 kVerifyTiEnrollment = 0,
151 kVerifyTiVerification = 1,
156 kVerifyTdEnrollment = 2,
161 kVerifyTdVerification = 3,
174 using Ptr = std::shared_ptr<QualityCheckEngine>;
184 static QualityCheckEngine::Ptr
Create(
const std::string& init_path);
Quality check engine class.
Definition: quality_check.h:172
static QualityCheckEngine::Ptr Create(const std::string &init_path)
Creates QualityCheckEngine instance.
virtual QualityCheckMetricsThresholds GetRecommendedThresholds(QualityCheckScenario scenario) const =0
Gets recommended quality checking thresholds for the specified scenario.
virtual QualityCheckEngineResult CheckQuality(const float *float_samples, size_t num_samples, size_t sample_rate, const QualityCheckMetricsThresholds &thresholds) const =0
Checks whether audio buffer is suitable from the quality perspective, from the given float audio samp...
virtual QualityCheckEngineResult CheckQuality(const std::string &audio_path, const QualityCheckMetricsThresholds &thresholds) const =0
Checks whether audio file is suitable from the quality perspective, from the given audio file.
virtual QualityCheckEngineResult CheckQuality(const uint8_t *pcm16_bytes, size_t num_bytes, size_t sample_rate, const QualityCheckMetricsThresholds &thresholds) const =0
Checks whether audio buffer is suitable from the quality perspective, from the given PCM16 audio samp...
virtual QualityCheckEngineResult CheckQuality(const int16_t *pcm16_samples, size_t num_samples, size_t sample_rate, const QualityCheckMetricsThresholds &threshold) const =0
Checks whether audio buffer is suitable from the quality perspective, from the given PCM16 audio samp...
Structure representing audio quality check result.
Definition: quality_check.h:18
QualityCheckShortDescription
Enumeration representing short quality check description.
Definition: quality_check.h:23
@ kTooSmallSpeechRelativeLength
Too small speech relative length (speech length relative to the total audio length).
@ kTooNoisy
Too noisy audio.
@ kMultipleSpeakersDetected
Multiple speakers detected.
@ kTooSmallSpeechLength
Too small speech length in the audio.
@ kOk
Audio successfully passed quality check.
float speech_relative_length
Speech relative length (speech length relative to the total audio length) metric value obtained on qu...
Definition: quality_check.h:63
float multiple_speakers_detector_score
Multiple speakers detector score value obtained on quality check.
Definition: quality_check.h:68
float snr_db
SNR metric value obtained on quality check in Db.
Definition: quality_check.h:53
QualityCheckShortDescription quality_check_short_description
Short description of the quality check results.
Definition: quality_check.h:73
float speech_length_ms
Speech length metric value obtained on quality check in milliseconds.
Definition: quality_check.h:58
Struct for quality checking metrics thresholds QualityCheckEngine::CheckQuality.
Definition: quality_check.h:117
float minimum_snr_db
Minimum signal-to-noise ratio required to pass quality check in dB.
Definition: quality_check.h:121
float minimum_speech_length_ms
Minimum speech length required to pass quality check in milliseconds.
Definition: quality_check.h:126
float maximum_multiple_speakers_detector_score
Maximum multiple speakers detector score allowed to pass quality check.
Definition: quality_check.h:136
float minimum_speech_relative_length
Minimum speech relative length (speech length relative to the total audio length) required to pass qu...
Definition: quality_check.h:131