Class Engine

java.lang.Object
com.vivoka.vsdk.asr.Engine
All Implemented Interfaces:
IEngine

public abstract class Engine extends Object implements IEngine
Abstract class representing the ASR engine. This class provides methods to initialize the engine, manage recognizers, and handle dynamic models.
  • Field Details

  • Constructor Details

    • Engine

      public Engine()
  • Method Details

    • getRecognizer

      public Recognizer getRecognizer(String name, IRecognizerListener listener) throws Exception
      Gets or creates a recognizer with the specified name and listener. If a recognizer with the given name already exists, the listener will be overridden by the new one.
      Parameters:
      name - The name of the recognizer.
      listener - The listener to handle recognizer events.
      Returns:
      The recognizer instance.
      Throws:
      Exception - If the recognizer cannot be created or found.
    • removeRecognizer

      public void removeRecognizer(String name) throws Exception
      Removes the recognizer with the specified name by releasing the recognizer resources.
      Parameters:
      name - The name of the recognizer to remove.
      Throws:
      Exception - If the recognizer cannot be removed.
    • getDynamicModel

      public DynamicModel getDynamicModel(String name) throws Exception
      Gets or creates a dynamic model with the specified name.
      Parameters:
      name - The name of the dynamic model.
      Returns:
      The dynamic model instance.
      Throws:
      Exception - If the dynamic model cannot be created or found.
    • removeDynamicModel

      public void removeDynamicModel(String name) throws Exception
      Removes the dynamic model with the specified name by releasing the model resources.
      Parameters:
      name - The name of the dynamic model to remove.
      Throws:
      Exception - If the dynamic model cannot be removed.
    • getUserWordEnroller

      public UserWordEnroller getUserWordEnroller(String recognizerName, IRecognizerListener listener) throws Exception
      Gets or creates a user word enroller with the specified recognizer.
      Parameters:
      recognizerName - name of the Recognizer used in enrollement
      Returns:
      A UserWordEnroller associated with @param recognizerName
      Throws:
      Exception
    • removeUserWordEnroller

      public void removeUserWordEnroller(String recognizerName) throws Exception
      Removes the user word enroller related to the specified recognizer by releasing the related resources.
      Parameters:
      recognizerName - name of the Recognizer used in enrollement
      Throws:
      Exception - If the user word enroller cannot be removed.
    • makeRecognizer

      protected abstract Recognizer makeRecognizer(String name, IRecognizerListener listener) throws Exception
      Throws:
      Exception
    • makeDynamicModel

      protected abstract DynamicModel makeDynamicModel(String name) throws Exception
      Throws:
      Exception
    • makeUserWordEnroller

      protected abstract UserWordEnroller makeUserWordEnroller(Recognizer recognizer, IRecognizerListener listener) throws Exception
      Throws:
      Exception