Class javax.speech.synthesis.SynthesizerEvent
java.lang.Object
|
+--java.util.EventObject
|
+--javax.speech.SpeechEvent
|
+--javax.speech.EngineEvent
|
+--javax.speech.synthesis.SynthesizerEvent
- public class SynthesizerEvent
- extends EngineEvent
Event issued by Synthesizer to indicate a change in
state or other activity. A SynthesizerEvent is
issued to each SynthesizerListener attached to a
Synthesizer using the addEngineListener
method it inherits from the Engine interface.
The SynthesizerEvent class extends the
EngineEvent class. Similarly, the
SynthesizerListener interface extends the
EngineListener interface.
SynthesizerEvent extends EngineEvent
with several events that are specialized for speech synthesis.
It also inherits several event types from EngineEvent:
ENGINE_ALLOCATED,
ENGINE_DEALLOCATED,
ENGINE_ALLOCATING_RESOURCES,
ENGINE_DEALLOCATING_RESOURCES,
ENGINE_PAUSED,
ENGINE_RESUMED.
- See Also:
- Synthesizer, SynthesizerListener, addEngineListener, EngineEvent, Serialized Form
|
Field Summary
|
|
static int
|
QUEUE_EMPTIED
The speaking queue of the Synthesizer has emptied
and the Synthesizer has changed to the
QUEUE_EMPTY state.
|
|
static int
|
QUEUE_UPDATED
The speech output queue has changed. |
|
boolean
|
topOfQueueChanged
topOfQueueChanged is true for
QUEUE_UPDATED event when the top item in the
speech output queue has changed.
|
|
Constructor Summary
|
SynthesizerEvent(Synthesizer source,
int id,
boolean topOfQueueChanged,
long oldEngineState,
long newEngineState)
Construct a SynthesizerEvent with a specified event id
and topOfQueueChanged flag.
|
| Methods inherited from class java.lang.Object |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
QUEUE_EMPTIED
public static final int QUEUE_EMPTIED
- The speaking queue of the
Synthesizer has emptied
and the Synthesizer has changed to the
QUEUE_EMPTY state.
The queue may become empty because speech output of all
items in the queue is completed, or because the items
have been cancelled.
The QUEUE_EMPTIED event follows the SPEAKABLE_ENDED
or SPEAKABLE_CANCELLED event that removed the last item
from the speaking queue.
- See Also:
- queueEmptied, cancel(), cancel(Object), cancelAll(), SPEAKABLE_ENDED, SPEAKABLE_CANCELLED, QUEUE_EMPTY
QUEUE_UPDATED
public static final int QUEUE_UPDATED
- The speech output queue has changed. This event may indicate
a change in state of the
Synthesizer from
QUEUE_EMPTY to QUEUE_NOT_EMPTY.
The event may also occur in the QUEUE_NOT_EMPTY
state without changing state.
the enumerateQueue method of Synthesizer
will return a changed list.
The speech output queue changes when (a) a new item is placed
on the queue with a call to one of the speak methods,
(b) when an item is removed from the queue with one of the
cancel methods (without emptying the queue), or (c) when output
of the top item of the queue is completed (again, without leaving
an empty queue).
The topOfQueueChanged boolean parameter is set
to true if the top item on the queue has changed.
- See Also:
- queueUpdated, getTopOfQueueChanged, SPEAKABLE_ENDED, QUEUE_NOT_EMPTY
topOfQueueChanged
protected boolean topOfQueueChanged
topOfQueueChanged is true for
QUEUE_UPDATED event when the top item in the
speech output queue has changed.
- See Also:
- getTopOfQueueChanged
SynthesizerEvent
public SynthesizerEvent(Synthesizer source,
int id,
boolean topOfQueueChanged,
long oldEngineState,
long newEngineState)
- Construct a
SynthesizerEvent with a specified event id
and topOfQueueChanged flag.
- Parameters:
source
- the Synthesizer that issued the event
id
- the identifier for the event type
topOfQueueChanged
- true if top item on speech output queue changed
oldEngineState
- engine state prior to this event
newEngineState
- engine state following this event
getTopOfQueueChanged
public boolean getTopOfQueueChanged()
- Return the
topOfQueueChanged value. The value
is true for a QUEUE_UPDATED event
when the top item in the speech output queue has changed.
- See Also:
- topOfQueueChanged
paramString
public String paramString()
- Returns a parameter string identifying this event.
This method is useful for event-logging and for debugging.
- Returns:
- a string identifying the event
- Overrides:
- paramString in class EngineEvent
JavaTM Speech API
Copyright 1997-1998 Sun Microsystems, Inc. All rights reserved
Send comments to javaspeech-comments@sun.com