Package net.idrnd.voicesdk.media
Class QualityCheckEngine
java.lang.Object
net.idrnd.voicesdk.common.VoiceSdkNativePeer
net.idrnd.voicesdk.media.QualityCheckEngine
- All Implemented Interfaces:
AutoCloseable
Performs audio quality check.
This class serves as gateway to native Voice SDK implementation and allocates resources on native heap.
To release the allocated memory, AutoCloseable.close() method should be invoked when the instance is no longer needed.
Any method that delegates to native call may throw VoiceSdkEngineException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckQuality(byte[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds) Checks whether audio buffer is suitable from the quality perspective, from the given PCM16 audio bytes.checkQuality(float[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds) Checks whether audio buffer is suitable from the quality perspective, from the given float audio samples.checkQuality(short[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds) Checks whether audio buffer is suitable from the quality perspective, rom the given PCM16 audio samples.checkQuality(String audioPath, QualityCheckMetricsThresholds thresholds) Checks whether audio file is suitable from the quality perspective, from the given audio file.getRecommendedThresholds(QualityCheckScenario scenario) Gets recommended quality checking thresholds for the specified scenarioMethods inherited from class net.idrnd.voicesdk.common.VoiceSdkNativePeer
close, equals, hashCode
-
Constructor Details
-
QualityCheckEngine
Initializes the instance.- Parameters:
initPath- exactly the same as forQualityCheckEngine- Throws:
VoiceSdkEngineException- wraps native exceptions
-
-
Method Details
-
getRecommendedThresholds
Gets recommended quality checking thresholds for the specified scenario- Parameters:
scenario- scenario for which recommended thresholds will be returned- Returns:
QualityCheckMetricsThresholds- Throws:
VoiceSdkEngineException- wraps native exceptions
-
checkQuality
public QualityCheckEngineResult checkQuality(String audioPath, QualityCheckMetricsThresholds thresholds) Checks whether audio file is suitable from the quality perspective, from the given audio file.- Parameters:
audioPath- path to audio filethresholds- quality checking thresholds that will be applied to the output quality check metrics- Returns:
QualityCheckEngineResult- Throws:
VoiceSdkEngineException- wraps native exceptions
-
checkQuality
public QualityCheckEngineResult checkQuality(byte[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds) Checks whether audio buffer is suitable from the quality perspective, from the given PCM16 audio bytes.- Parameters:
buffer- input array of byte samplessampleRate- sample frequency, Hzthresholds- quality checking thresholds that will be applied to the output quality check metrics- Returns:
QualityCheckEngineResult- Throws:
VoiceSdkEngineException- wraps native exceptions
-
checkQuality
public QualityCheckEngineResult checkQuality(short[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds) Checks whether audio buffer is suitable from the quality perspective, rom the given PCM16 audio samples.- Parameters:
buffer- input array of PCM16 samplessampleRate- sample frequency, Hzthresholds- quality checking thresholds that will be applied to the output quality check metrics- Returns:
QualityCheckEngineResult- Throws:
VoiceSdkEngineException- wraps native exceptions
-
checkQuality
public QualityCheckEngineResult checkQuality(float[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds) Checks whether audio buffer is suitable from the quality perspective, from the given float audio samples.- Parameters:
buffer- input array of float samples, values are limited by range [-1; 1]sampleRate- sample frequency, Hzthresholds- quality checking thresholds that will be applied to the output quality check metrics- Returns:
QualityCheckEngineResult- Throws:
VoiceSdkEngineException- wraps native exceptions
-