public class QualityCheckEngine extends VoiceSdkNativePeer
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
nativeId
Constructor and Description |
---|
QualityCheckEngine(java.lang.String initPath)
Initializes the instance.
|
Modifier and Type | Method and Description |
---|---|
QualityCheckEngineResult |
checkQuality(byte[] buffer,
int sampleRate,
QualityCheckMetricsThresholds thresholds)
Checks whether audio buffer is suitable from the quality perspective, from the given PCM16 audio bytes.
|
QualityCheckEngineResult |
checkQuality(float[] buffer,
int sampleRate,
QualityCheckMetricsThresholds thresholds)
Checks whether audio buffer is suitable from the quality perspective, from the given float audio samples.
|
QualityCheckEngineResult |
checkQuality(short[] buffer,
int sampleRate,
QualityCheckMetricsThresholds thresholds)
Checks whether audio buffer is suitable from the quality perspective, rom the given PCM16 audio samples.
|
QualityCheckEngineResult |
checkQuality(java.lang.String audioPath,
QualityCheckMetricsThresholds thresholds)
Checks whether audio file is suitable from the quality perspective, from the given audio file.
|
protected QualityCheckEngineResult |
checkQuality1(java.lang.String audioPath,
QualityCheckMetricsThresholds thresholds) |
protected QualityCheckEngineResult |
checkQuality2(float[] buffer,
int sampleRate,
QualityCheckMetricsThresholds thresholds) |
protected QualityCheckEngineResult |
checkQuality3(short[] buffer,
int sampleRate,
QualityCheckMetricsThresholds thresholds) |
protected QualityCheckEngineResult |
checkQuality4(byte[] buffer,
int sampleRate,
QualityCheckMetricsThresholds thresholds) |
QualityCheckMetricsThresholds |
getRecommendedThresholds(QualityCheckScenario scenario)
Gets recommended quality checking thresholds for the specified scenario
|
protected static long |
init(java.lang.String initPath) |
protected void |
release()
This method should release resources on native layer (indirectly using nativeId)
|
close, equals, finalize, hashCode
public QualityCheckEngine(java.lang.String initPath)
initPath
- exactly the same as for QualityCheckEngine
VoiceSdkEngineException
- wraps native exceptionspublic QualityCheckMetricsThresholds getRecommendedThresholds(QualityCheckScenario scenario)
scenario
- scenario for which recommended thresholds will be returnedQualityCheckMetricsThresholds
VoiceSdkEngineException
- wraps native exceptionspublic QualityCheckEngineResult checkQuality(java.lang.String audioPath, QualityCheckMetricsThresholds thresholds)
audioPath
- path to audio filethresholds
- quality checking thresholds that will be applied to the output quality check metricsQualityCheckEngineResult
VoiceSdkEngineException
- wraps native exceptionspublic QualityCheckEngineResult checkQuality(byte[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds)
buffer
- input array of byte samplessampleRate
- sample frequency, Hzthresholds
- quality checking thresholds that will be applied to the output quality check metricsQualityCheckEngineResult
VoiceSdkEngineException
- wraps native exceptionspublic QualityCheckEngineResult checkQuality(short[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds)
buffer
- input array of PCM16 samplessampleRate
- sample frequency, Hzthresholds
- quality checking thresholds that will be applied to the output quality check metricsQualityCheckEngineResult
VoiceSdkEngineException
- wraps native exceptionspublic QualityCheckEngineResult checkQuality(float[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds)
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 metricsQualityCheckEngineResult
VoiceSdkEngineException
- wraps native exceptionsprotected static long init(java.lang.String initPath)
protected QualityCheckEngineResult checkQuality1(java.lang.String audioPath, QualityCheckMetricsThresholds thresholds)
protected QualityCheckEngineResult checkQuality2(float[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds)
protected QualityCheckEngineResult checkQuality3(short[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds)
protected QualityCheckEngineResult checkQuality4(byte[] buffer, int sampleRate, QualityCheckMetricsThresholds thresholds)
protected void release()
VoiceSdkNativePeer
release
in class VoiceSdkNativePeer