Package org.jvoicexml.implementation.external

External listeners for synthesis and recognition events.

See:
          Description

Class Summary
SocketExternalListenerWorker This class handles all communications with external clients and is managed by a SocketExternalRecognitionListener or SocketExternalSynthesisListener.
SocketExternalRecognitionListener Class to send RecognitionResults as String to external clients.
SocketExternalSynthesisListener Class to send the synthesized output as String to a connected serversocket on localhost.
 

Package org.jvoicexml.implementation.external Description

External listeners for synthesis and recognition events.

If you wish to use this feature, have a look at the jvoicexml.xml-configuration file. The config's default path is <JVOICEXML-HOME>/config. Near the end of the config you can see an initialization-skeleton for your listeners.

It looks like

 <!--
  Implementation platform to handle recognition and speech synthesis.
 -->
 <bean id="org.jvoicexml.ImplementationPlatformFactory"
  class="org.jvoicexml.implementation.jvxml.JVoiceXmlImplementationPlatformFactory">
    <!-- 
    <property name="externalRecognitionListener">
        <bean class="YourClas" />
    </property>
    <property name="externalSynthesisListener">
        <bean class="YourClas" />
    </property>
    -->
 </bean>
 
As you can see, you can add your own classes as recognizer- and synthesizerlistener.

JVoiceXml also has sample implementations on board (see SocketExternalRecognitionListener and SocketExternalSynthesisListener ). In order to use these implementations the jvoicexml.xml-config needs to be adjusted.

An example-configuration could look like this

 <!--
  Implementation platform to handle recognition and speech synthesis.
 -->
 <bean id="org.jvoicexml.ImplementationPlatformFactory"
  class="org.jvoicexml.implementation.jvxml.JVoiceXmlImplementationPlatformFactory">
    <property name="externalRecognitionListener">
        <bean class="org.jvoicexml.implementation.external.SocketExternalRecognitionListener" >
                <property name="port" value="5555"/>
        </bean>
    </property>
    <property name="externalSynthesisListener">
        <bean class="org.jvoicexml.implementation.external.SocketExternalSynthesisListener" >
                <property name="port" value="5556"/>
        </bean>
    </property>
 </bean>
 

Short summary:

  1. Uncomment the two properties <property name="..."/> ("externalRecognitionListener" and "externalSynthesisListener")
  2. Add the specific implementation classes as <bean class/> (here SocketExternalRecognitionListener and SocketExternalSynthesisListener )
  3. Set the listening ports as <property name="port" .../> (here: "5555" for the recognizer and "5556" for the synthesis )



Copyright © 2005-2010JVoiceXML group.