org.jvoicexml
Interface SystemOutput

All Superinterfaces:
ExternalResource, RemoteConnectable
All Known Implementing Classes:
AudioOutput

public interface SystemOutput
extends ExternalResource, RemoteConnectable

Facade for easy access to the system output.

Objects that implement this interface support audio output using audio files and text-to-speech (TTS). They are able to freely sequence TTS and audio output.

If an audio output resource is not available, an error.noresource event is thrown. Audio files are referred to by a URI. The language specifies a required set of audio file formats which must be supported; additional audio file formats may also be supported.

Version:
$Revision: 214 $

Copyright © 2005-2006 JVoiceXML group - http://jvoicexml.sourceforge.net/

Author:
Dirk Schnelle

Method Summary
 void activate()
          Activate this system output, when it is retrieved from the pool.
 void cancelOutput()
          Cancels the current output from the TTS engine and queued audio for all entries in the queue that allow bargein.
 void passivate()
          Passivates this system output, when it is returned to the pool.
 void queueAudio(AudioInputStream audio)
          The audio, delivered by the audio stream is queued after the last element in the speaking queue.
 void queueSpeakable(SpeakableText speakable, boolean bargein, DocumentServer documentServer)
          The Speakable object is added to the end of the speaking queue and will be spoken once it reaches the top of the queue.
 
Methods inherited from interface org.jvoicexml.ExternalResource
close, getType, open
 
Methods inherited from interface org.jvoicexml.RemoteConnectable
connect
 

Method Detail

queueSpeakable

void queueSpeakable(SpeakableText speakable,
                    boolean bargein,
                    DocumentServer documentServer)
                    throws NoresourceError,
                           BadFetchError
The Speakable object is added to the end of the speaking queue and will be spoken once it reaches the top of the queue.

Parameters:
speakable - Text to be spoken.
bargein - true if the output can be cancelled.
documentServer - The document server to use.
Throws:
NoresourceError - The output resource is not available.
BadFetchError - A URI within the speakable could not be obtained or a parsing error occured.

queueAudio

void queueAudio(AudioInputStream audio)
                throws NoresourceError,
                       BadFetchError
The audio, delivered by the audio stream is queued after the last element in the speaking queue.

If bargein can be used while queuing the audio depends on the surrounding <prompt>.

Parameters:
audio - Stream with audio data.
Throws:
NoresourceError - The output resource is not available.
BadFetchError - Error reading from the AudioStream.
Since:
0.3

cancelOutput

void cancelOutput()
                  throws NoresourceError
Cancels the current output from the TTS engine and queued audio for all entries in the queue that allow bargein.

The implementation has to maintain a list of cancellable outputs dependingon the bargein flag.

Throws:
NoresourceError - The output resource is not available.
Since:
0.5

activate

void activate()
Activate this system output, when it is retrieved from the pool.

Specified by:
activate in interface ExternalResource
Since:
0.5.5

passivate

void passivate()
Passivates this system output, when it is returned to the pool.

Specified by:
passivate in interface ExternalResource
Since:
0.5.5


Copyright © 2005-2007 JVoiceXML group.