org.jvoicexml.implementation.mary
Class MaryAudioOutput

java.lang.Object
  extended by org.jvoicexml.implementation.mary.MaryAudioOutput
All Implemented Interfaces:
EventListener, LineListener

public final class MaryAudioOutput
extends Object
implements LineListener

Lineoutput for Mary.

Since:
0.6
Version:
$Revision: 2355 $
Author:
Dirk Schnelle-Walka, Giannis Assiouras

Constructor Summary
MaryAudioOutput(Object lock)
          Constructs a new object.
 
Method Summary
 void cancelOutput()
          Cancels the currently playing audio.
 boolean isBusy()
          Checks if there is currently an audio playing.
 void queueAudio(ByteArrayInputStream inputStream)
           
 void update(LineEvent event)
           Notifies the SynthesisQueue Thread that the audio has been played.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaryAudioOutput

public MaryAudioOutput(Object lock)
Constructs a new object.

Parameters:
lock - object in which SynthesisQueue Thread waits until audio playing is complete
Method Detail

queueAudio

public void queueAudio(ByteArrayInputStream inputStream)
                throws LineUnavailableException,
                       IOException,
                       UnsupportedAudioFileException
Parameters:
inputStream - that contains the processed data from the Mary Server
Throws:
LineUnavailableException - if a clip object is not available due to resource restrictions
IOException - if an I/O Exception occurs
UnsupportedAudioFileException - if the stream does not point to valid audio file data recognized by the system

cancelOutput

public void cancelOutput()
Cancels the currently playing audio.


isBusy

public boolean isBusy()
Checks if there is currently an audio playing.

Returns:
true if there is an active output.

update

public void update(LineEvent event)
Notifies the SynthesisQueue Thread that the audio has been played.

Specified by:
update in interface LineListener


Copyright © 2010-2011JVoiceXML group.