com.elantts.tts.jsapi
Interface ElanAudioListener

All Superinterfaces:
javax.speech.AudioListener, java.util.EventListener
All Known Implementing Classes:
JSoundCardAudioListener, JStreamAudioListener

public interface ElanAudioListener
extends javax.speech.AudioListener

As you can read in the Sun JSAPI specifications, until the Java Sound API is finalized, the AudioManager and other audio classes and interfaces will remain as placeholders for future expansion. Only the Recognizer audio events are functional in the current release. That’s why we had to provide ourselves mechanisms to enable client application to manage the synthesized sound. So we extended the javax.speech.AudioListener interface.


Method Summary
 int getFreeSpace()
          use by the synthesizer to ensure the sound capacity of the application.
 void write(byte[] signal, int off, int len)
          Used by the Synthesizer to send a sound packet to the application.
 

Method Detail

write

public void write(byte[] signal,
                  int off,
                  int len)
           throws javax.speech.AudioException
Used by the Synthesizer to send a sound packet to the application.

Parameters:
signal - a byte array containing a sound packet.
off - an offset that will be 0 in current implementation.
len - the length in bytes of the signal.
Throws:
javax.speech.AudioException - application could throw an AudioException when an error has occured.

getFreeSpace

public int getFreeSpace()
use by the synthesizer to ensure the sound capacity of the application. If the returned value is too small the synthesizer will make a small packet or wait for a largest capacity before sending more sound.

Returns:
the sound capacity.