Package com.vivoka.vsdk.asr
Class Engine
java.lang.Object
com.vivoka.vsdk.asr.Engine
- All Implemented Interfaces:
IEngine
Abstract class representing the ASR engine.
This class provides methods to initialize the engine, manage recognizers,
and handle dynamic models.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String, DynamicModel> protected final Map<String, Recognizer> protected final Map<String, UserWordEnroller> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDynamicModel(String name) Gets or creates a dynamic model with the specified name.getRecognizer(String name, IRecognizerListener listener) Gets or creates a recognizer with the specified name and listener.getUserWordEnroller(String recognizerName, IRecognizerListener listener) Gets or creates a user word enroller with the specified recognizer.protected abstract DynamicModelmakeDynamicModel(String name) protected abstract RecognizermakeRecognizer(String name, IRecognizerListener listener) protected abstract UserWordEnrollermakeUserWordEnroller(Recognizer recognizer, IRecognizerListener listener) voidremoveDynamicModel(String name) Removes the dynamic model with the specified name by releasing the model resources.voidremoveRecognizer(String name) Removes the recognizer with the specified name by releasing the recognizer resources.voidremoveUserWordEnroller(String recognizerName) Removes the user word enroller related to the specified recognizer by releasing the related resources.
-
Field Details
-
_recognizers
-
_dynamicModels
-
_userWordEnrollers
-
-
Constructor Details
-
Engine
public Engine()
-
-
Method Details
-
getRecognizer
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
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
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
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
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
- Throws:
Exception
-
makeUserWordEnroller
protected abstract UserWordEnroller makeUserWordEnroller(Recognizer recognizer, IRecognizerListener listener) throws Exception - Throws:
Exception
-