org.jvoicexml.implementation.mrcpv2
Class Mrcpv2SynthesizedOutput

java.lang.Object
  extended by org.jvoicexml.implementation.mrcpv2.Mrcpv2SynthesizedOutput
All Implemented Interfaces:
ExternalResource, ObservableSynthesizedOutput, OutputDevice, SynthesizedOutput, RemoteConnectable, org.speechforge.cairo.client.SpeechEventListener

public final class Mrcpv2SynthesizedOutput
extends Object
implements SynthesizedOutput, ObservableSynthesizedOutput, org.speechforge.cairo.client.SpeechEventListener

Audio output that uses the MRCPv2 to address the TTS engine.

Handle all MRCPv2 calls to the TTS engine.

Since:
0.7
Version:
$Revision: 2694 $
Author:
Spencer Lord, Dirk Schnelle-Walka

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.speechforge.cairo.client.SpeechEventListener
org.speechforge.cairo.client.SpeechEventListener.DtmfEventType, org.speechforge.cairo.client.SpeechEventListener.SpeechEventType
 
Constructor Summary
Mrcpv2SynthesizedOutput()
          Constructs a object.
 
Method Summary
 void activate()
          
 void addListener(SynthesizedOutputListener outputListener)
          
 void cancelOutput()
          
 void characterEventReceived(String c, org.speechforge.cairo.client.SpeechEventListener.DtmfEventType status)
          
 void close()
          
 void connect(ConnectionInformation client)
          
 void disconnect(ConnectionInformation client)
          
 int getRtpReceiverPort()
           
 org.speechforge.cairo.client.SessionManager getSessionManager()
           
 String getType()
          
 URI getUriForNextSynthesisizedOutput()
          
 boolean isBusy()
          
 void open()
          
 void passivate()
          
 void queuePlaintext(String text)
          Speaks a plain text string.
 void queueSpeakable(SpeakableText speakable, String sessionId, DocumentServer documentServer)
           Checks the type of the given speakable and forwards it either as for SSML output or for plain text output.
 void recognitionEventReceived(org.speechforge.cairo.client.SpeechEventListener.SpeechEventType event, org.speechforge.cairo.client.recog.RecognitionResult result)
          
 void removeListener(SynthesizedOutputListener outputListener)
          
 void setRtpReceiverPort(int port)
          Sets the RTP receiver port.
 void setSessionManager(org.speechforge.cairo.client.SessionManager manager)
           
 void setType(String resourceType)
          Sets the type of this resource.
 void speechSynthEventReceived(org.speechforge.cairo.client.SpeechEventListener.SpeechEventType event)
          
 boolean supportsBargeIn()
          
 void waitNonBargeInPlayed()
          
 void waitQueueEmpty()
          Convenient method to wait until all output is being played.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mrcpv2SynthesizedOutput

public Mrcpv2SynthesizedOutput()
Constructs a object.

Method Detail

open

public void open()
          throws NoresourceError

Specified by:
open in interface ExternalResource
Throws:
NoresourceError

close

public void close()

Specified by:
close in interface ExternalResource

addListener

public void addListener(SynthesizedOutputListener outputListener)

Specified by:
addListener in interface ObservableSynthesizedOutput

removeListener

public void removeListener(SynthesizedOutputListener outputListener)

Specified by:
removeListener in interface ObservableSynthesizedOutput

queueSpeakable

public void queueSpeakable(SpeakableText speakable,
                           String sessionId,
                           DocumentServer documentServer)
                    throws NoresourceError,
                           BadFetchError
Checks the type of the given speakable and forwards it either as for SSML output or for plain text output.

Specified by:
queueSpeakable in interface SynthesizedOutput
Throws:
NoresourceError
BadFetchError

queuePlaintext

public void queuePlaintext(String text)
                    throws NoresourceError,
                           BadFetchError
Speaks a plain text string.

Parameters:
text - String contains plain text to be spoken.
Throws:
NoresourceError - No synthesizer allocated.
BadFetchError - Synthesizer in wrong state.

supportsBargeIn

public boolean supportsBargeIn()

Specified by:
supportsBargeIn in interface OutputDevice

cancelOutput

public void cancelOutput()
                  throws NoresourceError

Specified by:
cancelOutput in interface OutputDevice
Throws:
NoresourceError

waitNonBargeInPlayed

public void waitNonBargeInPlayed()

Specified by:
waitNonBargeInPlayed in interface SynthesizedOutput

waitQueueEmpty

public void waitQueueEmpty()
Convenient method to wait until all output is being played.

Specified by:
waitQueueEmpty in interface SynthesizedOutput

activate

public void activate()

Specified by:
activate in interface ExternalResource

passivate

public void passivate()

Specified by:
passivate in interface ExternalResource

connect

public void connect(ConnectionInformation client)
             throws IOException

Specified by:
connect in interface RemoteConnectable
Throws:
IOException

disconnect

public void disconnect(ConnectionInformation client)

Specified by:
disconnect in interface RemoteConnectable

getType

public String getType()

Specified by:
getType in interface ExternalResource

setType

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

Parameters:
resourceType - type of the resource

getUriForNextSynthesisizedOutput

public URI getUriForNextSynthesisizedOutput()
                                     throws NoresourceError,
                                            URISyntaxException

Specified by:
getUriForNextSynthesisizedOutput in interface SynthesizedOutput
Throws:
NoresourceError
URISyntaxException

isBusy

public boolean isBusy()

Specified by:
isBusy in interface ExternalResource
Specified by:
isBusy in interface OutputDevice

speechSynthEventReceived

public void speechSynthEventReceived(org.speechforge.cairo.client.SpeechEventListener.SpeechEventType event)

Specified by:
speechSynthEventReceived in interface org.speechforge.cairo.client.SpeechEventListener

recognitionEventReceived

public void recognitionEventReceived(org.speechforge.cairo.client.SpeechEventListener.SpeechEventType event,
                                     org.speechforge.cairo.client.recog.RecognitionResult result)

Specified by:
recognitionEventReceived in interface org.speechforge.cairo.client.SpeechEventListener

characterEventReceived

public void characterEventReceived(String c,
                                   org.speechforge.cairo.client.SpeechEventListener.DtmfEventType status)

Specified by:
characterEventReceived in interface org.speechforge.cairo.client.SpeechEventListener

getRtpReceiverPort

public int getRtpReceiverPort()
Returns:
the receiverPort

setRtpReceiverPort

public void setRtpReceiverPort(int port)
Sets the RTP receiver port.

Parameters:
port - the receiverPort to set

getSessionManager

public org.speechforge.cairo.client.SessionManager getSessionManager()
Returns:
the sessionManager

setSessionManager

public void setSessionManager(org.speechforge.cairo.client.SessionManager manager)
Parameters:
manager - the sessionManager to set


Copyright © 2008-2010JVoiceXML group.