public class SpeechSummaryEngine extends VoiceSdkNativePeer
SpeechSummary
over various types of 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 |
---|
SpeechSummaryEngine(java.lang.String initPath)
Initializes the engine, allocating native memory.
|
Modifier and Type | Method and Description |
---|---|
SpeechSummaryStream |
createStream(int sampleRate)
Produces
SpeechSummaryStream that accepts audio data with the specified constant sampling rate. |
SpeechSummary |
getSpeechSummary(byte[] pcm16Bytes,
int sampleRate)
Calculates
SpeechSummary over the specified audio buffer provided as an array of PCM16 samples. |
SpeechSummary |
getSpeechSummary(float[] floatSamples,
int sampleRate)
Calculates
SpeechSummary over the specified audio buffer provided as an array of normalized float values. |
SpeechSummary |
getSpeechSummary(short[] pcm16Samples,
int sampleRate)
Calculates
SpeechSummary over the specified audio buffer provided as an array of PCM16 samples. |
SpeechSummary |
getSpeechSummary(java.lang.String audioFile)
Calculates
SpeechSummary over the specified audio record. |
protected SpeechSummary |
getSpeechSummary1(byte[] pcm16Bytes,
int sampleRate) |
protected SpeechSummary |
getSpeechSummary2(short[] pcm16Samples,
int sampleRate) |
protected SpeechSummary |
getSpeechSummary3(float[] floatSamples,
int sampleRate) |
protected SpeechSummary |
getSpeechSummary4(java.lang.String audioFile) |
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 SpeechSummaryEngine(java.lang.String initPath)
initPath
- path to the initialization folder containing the required binaries and configuration filesVoiceSdkEngineException
- wraps native exceptionspublic SpeechSummary getSpeechSummary(byte[] pcm16Bytes, int sampleRate)
SpeechSummary
over the specified audio buffer provided as an array of PCM16 samples.pcm16Bytes
- Array of little-endian PCM16 audio bytessampleRate
- audio stream sampling rate, HzSpeechSummary
VoiceSdkEngineException
- wraps native exceptionspublic SpeechSummary getSpeechSummary(short[] pcm16Samples, int sampleRate)
SpeechSummary
over the specified audio buffer provided as an array of PCM16 samples.pcm16Samples
- Array of PCM16 audio samplessampleRate
- audio stream sampling rate, HzSpeechSummary
VoiceSdkEngineException
- wraps native exceptionspublic SpeechSummary getSpeechSummary(float[] floatSamples, int sampleRate)
SpeechSummary
over the specified audio buffer provided as an array of normalized float values.floatSamples
- Array of float audio samples (in [-1, 1] range)sampleRate
- audio stream sampling rate, HzSpeechSummary
VoiceSdkEngineException
- wraps native exceptionspublic SpeechSummary getSpeechSummary(java.lang.String audioFile)
SpeechSummary
over the specified audio record.audioFile
- Path to the audio fileSpeechSummary
VoiceSdkEngineException
- wraps native exceptionspublic SpeechSummaryStream createStream(int sampleRate)
SpeechSummaryStream
that accepts audio data with the specified constant sampling rate.sampleRate
- audio stream sampling rate, HzSpeechSummaryStream
VoiceSdkEngineException
- wraps native exceptionsprotected static long init(java.lang.String initPath)
protected void release()
VoiceSdkNativePeer
release
in class VoiceSdkNativePeer
protected SpeechSummary getSpeechSummary1(byte[] pcm16Bytes, int sampleRate)
protected SpeechSummary getSpeechSummary2(short[] pcm16Samples, int sampleRate)
protected SpeechSummary getSpeechSummary3(float[] floatSamples, int sampleRate)
protected SpeechSummary getSpeechSummary4(java.lang.String audioFile)