|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSpeechEvent
EngineEvent
SynthesizerEvent
public class SynthesizerEvent
Event issued by a Synthesizer
to indicate a change
in state or other activity.
A SynthesizerEvent
is issued to each SynthesizerListener
attached to a Synthesizer
using the addSynthesizerListener
method in the Synthesizer
interface.
Synthesizer
,
SynthesizerListener
,
addSynthesizerListener
,
removeSynthesizerListener
Field Summary | |
---|---|
static int |
DEFAULT_MASK
The default mask for events in this class. |
static int |
QUEUE_EMPTIED
Event issued when the Synthesizer output queue has emptied and
the Synthesizer has changed to the QUEUE_EMPTY state. |
static int |
QUEUE_UPDATED
Event issued when the Synthesizer output queue updates. |
static int |
SYNTHESIZER_BUFFER_READY
Event issued once audio output begins to flow normally after a gap. |
static int |
SYNTHESIZER_BUFFER_UNFILLED
Event issued when a gap in synthesis output is detected. |
Fields inherited from class EngineEvent |
---|
ENGINE_ALLOCATED, ENGINE_ALLOCATING_RESOURCES, ENGINE_DEALLOCATED, ENGINE_DEALLOCATING_RESOURCES, ENGINE_DEFOCUSED, ENGINE_ERROR, ENGINE_FOCUSED, ENGINE_PAUSED, ENGINE_RESUMED |
Fields inherited from class SpeechEvent |
---|
DISABLE_ALL, ENABLE_ALL |
Constructor Summary | |
---|---|
SynthesizerEvent(Synthesizer source,
int id,
long oldEngineState,
long newEngineState,
Throwable problem,
boolean topOfQueueChanged)
Constructs a SynthesizerEvent to indicate a
change in state or other activity. |
Method Summary | |
---|---|
boolean |
isTopOfQueueChanged()
Returns the change status of the top of the Synthesizer
output queue. |
String |
paramString()
Returns a parameter String that contains
the event ID in text form. |
String |
toString()
Returns a printable String . |
Methods inherited from class EngineEvent |
---|
getEngineError, getNewEngineState, getOldEngineState |
Methods inherited from class SpeechEvent |
---|
getId, getSource |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int QUEUE_EMPTIED
Synthesizer
output queue has emptied and
the Synthesizer
has changed to the QUEUE_EMPTY
state.
The queue may become empty because output completes for all queued items
or because the items have been cancelled.
The isTopOfQueueChanged
method always returns true
for this event.
This event follows the SPEAKABLE_ENDED
or
SPEAKABLE_CANCELLED
event that removed the last item from the
queue.
QUEUE_UPDATED
,
QUEUE_EMPTY
,
isTopOfQueueChanged()
,
SPEAKABLE_ENDED
,
SPEAKABLE_CANCELLED
,
cancel()
,
cancel(int)
,
cancelAll()
,
DEFAULT_MASK
,
Constant Field Valuespublic static final int QUEUE_UPDATED
Synthesizer
output queue updates.
This event may indicate a change in Synthesizer
state from
QUEUE_EMPTY
to QUEUE_NOT_EMPTY
.
This event may also occur in the
QUEUE_NOT_EMPTY
state without changing state.
The Synthesizer
output queue updates when
speak
or speakMarkup
methods,
cancel
methods
(without emptying the queue), or
QUEUE_EMPTIED
event is issued rather than this event.
The isTopOfQueueChanged
method returns true
if the
top item on the queue has changed.
This event follows the SPEAKABLE_ENDED
or
SPEAKABLE_CANCELLED
event that updated the queue.
This event is not enabled by default.
It may be enabled with setEngineMask
.
QUEUE_EMPTIED
,
QUEUE_EMPTY
,
QUEUE_NOT_EMPTY
,
isTopOfQueueChanged()
,
SPEAKABLE_ENDED
,
SPEAKABLE_CANCELLED
,
cancel()
,
cancel(int)
,
cancelAll()
,
DEFAULT_MASK
,
setEngineMask
,
Constant Field Valuespublic static final int SYNTHESIZER_BUFFER_UNFILLED
Synthesizer
output queue contains more items to synthesize,
but the Synthesizer
's internal audio buffer is empty.
This can indicate that the Synthesizer
is not
keeping up with real-time
requirements to ensure that the generated audio plays continuously.
If significant gaps occur, an application may wish to resubmit the
affected items.
A SYNTHESIZER_BUFFER_READY
event is issued
once audio begins to flow normally.
SYNTHESIZER_BUFFER_READY
,
Constant Field Valuespublic static final int SYNTHESIZER_BUFFER_READY
SYNTHESIZER_BUFFER_UNFILLED
event is followed by this event.
SYNTHESIZER_BUFFER_UNFILLED
provides more detail about
gaps in synthesis.
SYNTHESIZER_BUFFER_UNFILLED
,
Constant Field Valuespublic static final int DEFAULT_MASK
The following events, in addition to events in
EngineEvent.DEFAULT_MASK
, are delivered by default:
QUEUE_EMPTIED
, SYNTHESIZER_BUFFER_UNFILLED
, and
SYNTHESIZER_BUFFER_READY
.
The QUEUE_UPDATED
event may be enabled if desired
with setEngineMask
.
EngineEvent.DEFAULT_MASK
,
QUEUE_EMPTIED
,
QUEUE_UPDATED
,
SYNTHESIZER_BUFFER_UNFILLED
,
SYNTHESIZER_BUFFER_READY
,
setEngineMask
,
Constant Field ValuesConstructor Detail |
---|
public SynthesizerEvent(Synthesizer source, int id, long oldEngineState, long newEngineState, Throwable problem, boolean topOfQueueChanged) throws IllegalArgumentException
SynthesizerEvent
to indicate a
change in state or other activity.
oldEngineState
and newEngineState
are 0
if the
Engine
states are unknown or undefined.
problem
applies to ENGINE_ERROR
and
must be null
for other events.
The topOfQueueChanged
flag applies to QUEUE_UPDATED
and QUEUE_EMPTIED
.
It is true
if the top item on the
Synthesizer
output queue changed.
This flag must be false
for all other events.
source
- the Synthesizer
that issued the eventid
- the event identifieroldEngineState
- the Engine
state prior to this eventnewEngineState
- the Engine
state following this eventproblem
- non-null
for ENGINE_ERROR
,
otherwise null
topOfQueueChanged
- boolean
flag for
QUEUE_UPDATED
and QUEUE_EMPTIED
,
otherwise false
IllegalArgumentException
- if called with an inappropriate
event identifier or an invalid parameter valueisTopOfQueueChanged
,
ENGINE_ERROR
,
QUEUE_EMPTIED
,
QUEUE_UPDATED
,
SYNTHESIZER_BUFFER_UNFILLED
,
SYNTHESIZER_BUFFER_READY
Method Detail |
---|
public boolean isTopOfQueueChanged()
Synthesizer
output queue.
The value is true
when the top item
in the Synthesizer
output queue has changed.
This method applies to the
QUEUE_UPDATED
and QUEUE_EMPTIED
events.
For all other events, this method returns false
.
true
when the top of the Synthesizer
output queue has changedQUEUE_UPDATED
,
QUEUE_EMPTIED
public String paramString()
String
that contains
the event ID in text form.
This method is useful for event-logging and for debugging.
The method toString
may provide more detail.
paramString
in class EngineEvent
String
that contains the event ID in text formtoString
public String toString()
String
.
Useful for event-logging and debugging.
The method paramString
also provides printable information.
toString
in class SpeechEvent
paramString
|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Speech API 2.0,
Final Release v2.0.6.
© 2008, Conversay and Sun Microsystems.