Package net.idrnd.voicesdk.media
Class SpeechSummaryEngine
java.lang.Object
net.idrnd.voicesdk.common.VoiceSdkNativePeer
net.idrnd.voicesdk.media.SpeechSummaryEngine
- All Implemented Interfaces:
AutoCloseable
Provides the set of capabilities related to calculation
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
-
Constructor Summary
ConstructorsConstructorDescriptionSpeechSummaryEngine(String initPath) Initializes the engine, allocating native memory. -
Method Summary
Modifier and TypeMethodDescriptioncreateStream(int sampleRate) ProducesSpeechSummaryStreamthat accepts audio data with the specified constant sampling rate.getSpeechSummary(byte[] pcm16Bytes, int sampleRate) CalculatesSpeechSummaryover the specified audio buffer provided as an array of PCM16 samples.getSpeechSummary(float[] floatSamples, int sampleRate) CalculatesSpeechSummaryover the specified audio buffer provided as an array of normalized float values.getSpeechSummary(short[] pcm16Samples, int sampleRate) CalculatesSpeechSummaryover the specified audio buffer provided as an array of PCM16 samples.getSpeechSummary(String audioFile) CalculatesSpeechSummaryover the specified audio record.Methods inherited from class net.idrnd.voicesdk.common.VoiceSdkNativePeer
close, equals, hashCode
-
Constructor Details
-
SpeechSummaryEngine
Initializes the engine, allocating native memory.- Parameters:
initPath- path to the initialization folder containing the required binaries and configuration files- Throws:
VoiceSdkEngineException- wraps native exceptions
-
-
Method Details
-
getSpeechSummary
CalculatesSpeechSummaryover the specified audio buffer provided as an array of PCM16 samples.- Parameters:
pcm16Bytes- Array of little-endian PCM16 audio bytessampleRate- audio stream sampling rate, Hz- Returns:
SpeechSummary- Throws:
VoiceSdkEngineException- wraps native exceptions
-
getSpeechSummary
CalculatesSpeechSummaryover the specified audio buffer provided as an array of PCM16 samples.- Parameters:
pcm16Samples- Array of PCM16 audio samplessampleRate- audio stream sampling rate, Hz- Returns:
SpeechSummary- Throws:
VoiceSdkEngineException- wraps native exceptions
-
getSpeechSummary
CalculatesSpeechSummaryover the specified audio buffer provided as an array of normalized float values.- Parameters:
floatSamples- Array of float audio samples (in [-1, 1] range)sampleRate- audio stream sampling rate, Hz- Returns:
SpeechSummary- Throws:
VoiceSdkEngineException- wraps native exceptions
-
getSpeechSummary
CalculatesSpeechSummaryover the specified audio record.- Parameters:
audioFile- Path to the audio file- Returns:
SpeechSummary- Throws:
VoiceSdkEngineException- wraps native exceptions
-
createStream
ProducesSpeechSummaryStreamthat accepts audio data with the specified constant sampling rate.- Parameters:
sampleRate- audio stream sampling rate, Hz- Returns:
SpeechSummaryStream- Throws:
VoiceSdkEngineException- wraps native exceptions
-