Class SpeechSummaryEngine

java.lang.Object
net.idrnd.voicesdk.common.VoiceSdkNativePeer
net.idrnd.voicesdk.media.SpeechSummaryEngine
All Implemented Interfaces:
AutoCloseable

public class SpeechSummaryEngine extends VoiceSdkNativePeer
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 Details

    • SpeechSummaryEngine

      public SpeechSummaryEngine(String initPath)
      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

      public SpeechSummary getSpeechSummary(byte[] pcm16Bytes, int sampleRate)
      Calculates SpeechSummary over the specified audio buffer provided as an array of PCM16 samples.
      Parameters:
      pcm16Bytes - Array of little-endian PCM16 audio bytes
      sampleRate - audio stream sampling rate, Hz
      Returns:
      SpeechSummary
      Throws:
      VoiceSdkEngineException - wraps native exceptions
    • getSpeechSummary

      public SpeechSummary getSpeechSummary(short[] pcm16Samples, int sampleRate)
      Calculates SpeechSummary over the specified audio buffer provided as an array of PCM16 samples.
      Parameters:
      pcm16Samples - Array of PCM16 audio samples
      sampleRate - audio stream sampling rate, Hz
      Returns:
      SpeechSummary
      Throws:
      VoiceSdkEngineException - wraps native exceptions
    • getSpeechSummary

      public SpeechSummary getSpeechSummary(float[] floatSamples, int sampleRate)
      Calculates SpeechSummary over 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

      public SpeechSummary getSpeechSummary(String audioFile)
      Calculates SpeechSummary over the specified audio record.
      Parameters:
      audioFile - Path to the audio file
      Returns:
      SpeechSummary
      Throws:
      VoiceSdkEngineException - wraps native exceptions
    • createStream

      public SpeechSummaryStream createStream(int sampleRate)
      Produces SpeechSummaryStream that accepts audio data with the specified constant sampling rate.
      Parameters:
      sampleRate - audio stream sampling rate, Hz
      Returns:
      SpeechSummaryStream
      Throws:
      VoiceSdkEngineException - wraps native exceptions