org.jvoicexml.implementation.mary
Class MarySynthesizedOutput

java.lang.Object
  extended by org.jvoicexml.implementation.mary.MarySynthesizedOutput
All Implemented Interfaces:
ExternalResource, ObservableSynthesizedOutput, OutputDevice, SynthesizedOutput, SynthesizedOutputListener, RemoteConnectable

public final class MarySynthesizedOutput
extends Object
implements SynthesizedOutput, ObservableSynthesizedOutput, SynthesizedOutputListener

An implementation of the SynthesizedOutput for the Mary TTS System.

Since:
0.7.3
Version:
$Revision: 2694 $
Author:
Dirk Schnelle-Walka, Giannis Assiouras

Constructor Summary
MarySynthesizedOutput()
          Constructs a new MarySynthesizedOutput object.
 
Method Summary
 void activate()
          
 void addListener(SynthesizedOutputListener outputListener)
          
 void cancelAudioOutput()
          Stops the currently playing Audio.
 void cancelOutput()
          
 void close()
          
 void connect(ConnectionInformation info)
           It creates the MaryClient and starts the synthesisQueue thread.
 void disconnect(ConnectionInformation info)
          
 String getType()
          
 URI getUriForNextSynthesisizedOutput()
          
 boolean isBusy()
          
 void open()
           
 void outputError(ErrorEvent error)
          
 void outputStatusChanged(SynthesizedOutputEvent event)
          Gets the events fired from SynthesisQueue thread and it forwards them.
 void passivate()
          
 void queueSpeakable(SpeakableText speakable, String sessionId, DocumentServer server)
           The queueSpeakable method simply offers a speakable to the queue.
 void removeListener(SynthesizedOutputListener outputListener)
          
 void setAudioType(String value)
          Sets the audio output.
 void setLang(String lang)
          Sets the language.
 void setType(String resourceType)
          Sets the type of this resource.
 void setVoiceName(String name)
          Sets the name of the voice to use.
 boolean supportsBargeIn()
          
 void waitNonBargeInPlayed()
          
 void waitQueueEmpty()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarySynthesizedOutput

public MarySynthesizedOutput()
Constructs a new MarySynthesizedOutput object.

Method Detail

getUriForNextSynthesisizedOutput

public URI getUriForNextSynthesisizedOutput()
                                     throws NoresourceError,
                                            URISyntaxException

Specified by:
getUriForNextSynthesisizedOutput in interface SynthesizedOutput
Throws:
NoresourceError
URISyntaxException

queueSpeakable

public void queueSpeakable(SpeakableText speakable,
                           String sessionId,
                           DocumentServer server)
                    throws NoresourceError
The queueSpeakable method simply offers a speakable to the queue. it notifies the synthesisQueue Thread and then it returns

Specified by:
queueSpeakable in interface SynthesizedOutput
Throws:
NoresourceError - if no MaryClient has been created

waitNonBargeInPlayed

public void waitNonBargeInPlayed()

Specified by:
waitNonBargeInPlayed in interface SynthesizedOutput

waitQueueEmpty

public void waitQueueEmpty()

Specified by:
waitQueueEmpty in interface SynthesizedOutput

activate

public void activate()

Specified by:
activate in interface ExternalResource

close

public void close()

Specified by:
close in interface ExternalResource

getType

public String getType()

Specified by:
getType in interface ExternalResource

open

public void open()
          throws NoresourceError
Specified by:
open in interface ExternalResource
Throws:
NoresourceError

passivate

public void passivate()

Specified by:
passivate in interface ExternalResource

connect

public void connect(ConnectionInformation info)
             throws IOException
It creates the MaryClient and starts the synthesisQueue thread.

Specified by:
connect in interface RemoteConnectable
Throws:
IOException

disconnect

public void disconnect(ConnectionInformation info)

Specified by:
disconnect in interface RemoteConnectable

cancelOutput

public void cancelOutput()

Specified by:
cancelOutput in interface OutputDevice

supportsBargeIn

public boolean supportsBargeIn()

Specified by:
supportsBargeIn in interface OutputDevice
Returns:
true

addListener

public void addListener(SynthesizedOutputListener outputListener)

Specified by:
addListener in interface ObservableSynthesizedOutput

removeListener

public void removeListener(SynthesizedOutputListener outputListener)

Specified by:
removeListener in interface ObservableSynthesizedOutput

setType

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

Parameters:
resourceType - type of the resource

outputStatusChanged

public void outputStatusChanged(SynthesizedOutputEvent event)
Gets the events fired from SynthesisQueue thread and it forwards them. to ImplementationPlatform it also sets the appropriate flags

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

isBusy

public boolean isBusy()

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

cancelAudioOutput

public void cancelAudioOutput()
                       throws NoresourceError
Stops the currently playing Audio.

Throws:
NoresourceError - .

setAudioType

public void setAudioType(String value)
Sets the audio output.

Parameters:
value - the new audio type

setVoiceName

public void setVoiceName(String name)
Sets the name of the voice to use.

Parameters:
name - the voice name

setLang

public void setLang(String lang)
Sets the language.

Parameters:
lang - the language

outputError

public void outputError(ErrorEvent error)

Specified by:
outputError in interface SynthesizedOutputListener


Copyright © 2010-2011JVoiceXML group.