org.jvoicexml.implementation.external
Class SocketExternalSynthesisListener

java.lang.Object
  extended by org.jvoicexml.implementation.external.SocketExternalSynthesisListener
All Implemented Interfaces:
ExternalSynthesisListener, SynthesizedOutputListener

public final class SocketExternalSynthesisListener
extends Object
implements ExternalSynthesisListener

Class to send the synthesized output as String to a connected serversocket on localhost.

Since:
0.7.4
Version:
$Revision: 2905 $
Author:
Josua Arndt, Dirk Schnelle-Walka

Constructor Summary
SocketExternalSynthesisListener()
          Constructs a new SocketExternalSynthesisListener.
 
Method Summary
 String getConcatenatedText(Node node)
          Generates a formated String out of the contents of the Node and their childs.
 void outputError(ErrorEvent error)
          An error occurred while an output processes an output.
 void outputStatusChanged(SynthesizedOutputEvent event)
          Notification about status changes in the SynthesizedOutput.
 void setPort(int portnumber)
          Set the port to be used.
 void start()
          Starts this external synthesized output listener.
 void stop()
          Stops this external synthesized output listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketExternalSynthesisListener

public SocketExternalSynthesisListener()
Constructs a new SocketExternalSynthesisListener.

Method Detail

setPort

public void setPort(int portnumber)
Set the port to be used.

Parameters:
portnumber - used port

outputStatusChanged

public void outputStatusChanged(SynthesizedOutputEvent event)
Notification about status changes in the SynthesizedOutput. Sends synthesized text as String.

Specified by:
outputStatusChanged in interface SynthesizedOutputListener
Parameters:
event - the output event.

getConcatenatedText

public String getConcatenatedText(Node node)
Generates a formated String out of the contents of the Node and their childs.

Parameters:
node - XML Node
Returns:
the node contents as a string

outputError

public void outputError(ErrorEvent error)
Description copied from interface: SynthesizedOutputListener
An error occurred while an output processes an output.

This method is intended to feed back errors that happen while the SystemOutput processes an output asynchronously. Errors that happen while the output is queued should be reported by throwing an appropriate error in the SystemOutput.queueSpeakable(org.jvoicexml.SpeakableText, String, org.jvoicexml.DocumentServer) method.

Specified by:
outputError in interface SynthesizedOutputListener
Parameters:
error - the error

start

public void start()
Starts this external synthesized output listener.

Specified by:
start in interface ExternalSynthesisListener

stop

public void stop()
Stops this external synthesized output listener.

Specified by:
stop in interface ExternalSynthesisListener


Copyright © 2005-2010JVoiceXML group.