public class AttributesEstimator extends VoiceSdkNativePeer
Attributes
from the supported set in provided audio data.
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 |
---|
AttributesEstimator(java.lang.String initPath)
Creates the instance and allocates native memory.
|
Modifier and Type | Method and Description |
---|---|
Attributes |
estimate(byte[] pcm16Bytes,
int sampleRate)
Estimates person attributes using given voice sample provided in PCM16 format.
|
Attributes |
estimate(float[] floatSamples,
int sampleRate)
Estimates person attributes using given voice sample provided in normalized float format.
|
Attributes |
estimate(short[] pcm16Samples,
int sampleRate)
Estimates person attributes using given voice sample provided in PCM16 format.
|
Attributes |
estimate(java.lang.String audioFile)
Estimates person attributes using given voice sample provided as path to audio file.
|
protected Attributes |
estimate0(java.lang.String audioFile) |
protected Attributes |
estimate1(byte[] pcm16Bytes,
int sampleRate) |
protected Attributes |
estimate2(short[] pcm16Samples,
int sampleRate) |
protected Attributes |
estimate3(float[] floatSamples,
int sampleRate) |
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 AttributesEstimator(java.lang.String initPath)
initPath
- full path to the directory with init dataVoiceSdkEngineException
- wraps native exceptionspublic Attributes estimate(java.lang.String audioFile)
audioFile
- Path to the audio fileAttributes
VoiceSdkEngineException
- wraps native exceptionspublic Attributes estimate(byte[] pcm16Bytes, int sampleRate)
pcm16Bytes
- Array of little-endian PCM16 audio bytessampleRate
- Sample rate of the audio, HzAttributes
VoiceSdkEngineException
- wraps native exceptionspublic Attributes estimate(short[] pcm16Samples, int sampleRate)
pcm16Samples
- Array of PCM16 audio samplessampleRate
- Sample rate of the audio, HzAttributes
VoiceSdkEngineException
- wraps native exceptionspublic Attributes estimate(float[] floatSamples, int sampleRate)
floatSamples
- Array of float audio samples (in [-1, 1] range)sampleRate
- Sample rate of the audio, HzAttributes
VoiceSdkEngineException
- wraps native exceptionsprotected static long init(java.lang.String initPath)
protected Attributes estimate0(java.lang.String audioFile)
protected Attributes estimate1(byte[] pcm16Bytes, int sampleRate)
protected Attributes estimate2(short[] pcm16Samples, int sampleRate)
protected Attributes estimate3(float[] floatSamples, int sampleRate)
protected void release()
VoiceSdkNativePeer
release
in class VoiceSdkNativePeer