org.jvoicexml.implementation.jsapi10
Class Jsapi10SpokenInputFactory

java.lang.Object
  extended by org.jvoicexml.implementation.jsapi10.Jsapi10SpokenInputFactory
All Implemented Interfaces:
ResourceFactory<SpokenInput>
Direct Known Subclasses:
Sphinx4SpokenInputFactory

public class Jsapi10SpokenInputFactory
extends Object
implements ResourceFactory<SpokenInput>

Demo implementation of a ResourceFactory for the SpokenInput based on JSAPI 1.0.

Custom implementations are expected to override registerEngineCentral() to register the JSAPI compliant EngineCentral for the Recognizer. Afterwards the default mechanisms of JSAPI 1.0 are used to instantiate the Recognizer.

The RecognizerModeDesc can be specified in the following ways:

  1. setting the default descriptor directly via setRecognizerModeDescriptor(RecognizerModeDesc) or by
  2. using a JVoiceXmlRecognizerModeDescFactory.

Since:
0.6
Version:
$Revision: 2355 $
Author:
Dirk Schnelle-Walka

Constructor Summary
Jsapi10SpokenInputFactory()
          Creates a new object and registers the engines.
 
Method Summary
 SpokenInput createResource()
          
 int getInstances()
          
 Class<SpokenInput> getResourceType()
          
 String getType()
          
 void registerEngineCentral()
          Registers the EngineCentral so that a Recognizer can be created via Central.createRecognizer(javax.speech.EngineModeDesc).
 void setInstances(int number)
          Sets the number of instances that this factory will create.
 void setRecognizerModeDescriptor(RecognizerModeDesc desc)
          Sets the factory for the default RecognizerModeDesc.
 void setRecognizerModeDescriptorFactory(RecognizerModeDescFactory desc)
          Sets the factory for the default RecognizerModeDesc.
 void setSynthesizedOutputConnectionHandler(SpokenInputConnectionHandler connectionHandler)
          Sets a custom connection handler.
 void setType(String resourceType)
          Sets the type of the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jsapi10SpokenInputFactory

public Jsapi10SpokenInputFactory()
Creates a new object and registers the engines.

Method Detail

registerEngineCentral

public void registerEngineCentral()
                           throws EngineException
Registers the EngineCentral so that a Recognizer can be created via Central.createRecognizer(javax.speech.EngineModeDesc).

Throws:
EngineException - Error registering the engine central.

createResource

public final SpokenInput createResource()
                                 throws NoresourceError

Specified by:
createResource in interface ResourceFactory<SpokenInput>
Throws:
NoresourceError

setInstances

public final void setInstances(int number)
Sets the number of instances that this factory will create.

Parameters:
number - Number of instances to create.

getInstances

public final int getInstances()

Specified by:
getInstances in interface ResourceFactory<SpokenInput>

getType

public final String getType()

Specified by:
getType in interface ResourceFactory<SpokenInput>

setType

public final void setType(String resourceType)
Sets the type of the resource.

Parameters:
resourceType - type of the resource.

setRecognizerModeDescriptorFactory

public final void setRecognizerModeDescriptorFactory(RecognizerModeDescFactory desc)
Sets the factory for the default RecognizerModeDesc.

Parameters:
desc - the factory.

setRecognizerModeDescriptor

public final void setRecognizerModeDescriptor(RecognizerModeDesc desc)
Sets the factory for the default RecognizerModeDesc.

Parameters:
desc - the factory.

setSynthesizedOutputConnectionHandler

public final void setSynthesizedOutputConnectionHandler(SpokenInputConnectionHandler connectionHandler)
Sets a custom connection handler.

Parameters:
connectionHandler - the connection handler.

getResourceType

public final Class<SpokenInput> getResourceType()

Specified by:
getResourceType in interface ResourceFactory<SpokenInput>


Copyright © 2005-2009JVoiceXML group.