|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectEngineMode
SynthesizerMode
public class SynthesizerMode
Provides information about a specific operating mode
of a Synthesizer
.
SynthesizerMode
extends EngineMode
with features
specific to speech synthesizers.
Like EngineMode
, there are two types of
SynthesizerMode
objects:
those created by the EngineManager
or returned by
a Synthesizer
instance and
those created by an application.
Engine
-created SynthesizerMode
objects are obtained from
the EngineManager
through the availableEngines
method.
They are also returned from a Synthesizer
instance
with the getEngineMode
method.
For Engine
-created SynthesizerMode
objects,
all features will be set to non-null
values.
Applications can create SynthesizerMode
objects
using the appropriate constructor.
Applications may leave any or all of the feature values
null
to indicate "don't care".
Typically, application-created SynthesizerMode
s are used to test
the Engine
-created SynthesizerMode
s to select an
appropriate synthesizer for creation.
The EngineMode
class describes additional
detail on Engine
selection.
Engine
creation is described in the documentation
for the EngineManager
class.
Engine
,
Synthesizer
,
getEngineMode
,
EngineMode
,
EngineManager
,
availableEngines
,
createEngine
Field Summary | |
---|---|
static SynthesizerMode |
DEFAULT
SynthesizerMode with all mode features
set to "don't care" values. |
Constructor Summary | |
---|---|
SynthesizerMode()
Constructs a SynthesizerMode with all mode features set
to don't care values. |
|
SynthesizerMode(SpeechLocale locale)
Constructs a SynthesizerMode with a given SpeechLocale
and other features set to don't care values. |
|
SynthesizerMode(String engineName,
String modeName,
Boolean running,
Boolean supportsLetterToSound,
Boolean supportsMarkup,
Voice[] voices)
Constructs a SynthesizerMode with the specified mode features. |
Method Summary | |
---|---|
boolean |
equals(Object mode)
Returns true if and only if the mode parameter
is not null and has equal values of all
mode features with this EngineMode . |
Boolean |
getSupportsMarkup()
Gets the supports markup feature. |
Voice[] |
getVoices()
Returns the list of Voice s specified
in this SynthesizerMode . |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
match(EngineMode require)
Determines whether a SynthesizerMode has all the features
specified by the require object. |
String |
toString()
Returns a String representation of this SynthesizerMode . |
Methods inherited from class EngineMode |
---|
getEngineName, getModeName, getRunning, getSupportsLetterToSound |
Methods inherited from class Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final SynthesizerMode DEFAULT
SynthesizerMode
with all mode features
set to "don't care" values.
This can be used to select a default Synthesizer
with
EngineManager.createEngine
.
The documentation for the Synthesizer
interface includes
an example of this.
Synthesizer
,
EngineManager
,
createEngine
Constructor Detail |
---|
public SynthesizerMode()
SynthesizerMode
with all mode features set
to don't care values.
SynthesizerMode(String, String, Boolean, Boolean, Boolean, Voice[])
public SynthesizerMode(SpeechLocale locale)
SynthesizerMode
with a given SpeechLocale
and other features set to don't care values.
This is a convenience constructor where the locale
is
used to construct a Voice
list of length one where
the Voice
contains the locale
and other
features are null
.
locale
- the desired SpeechLocale
Voice
,
SynthesizerMode(String, String, Boolean, Boolean, Boolean, Voice[])
public SynthesizerMode(String engineName, String modeName, Boolean running, Boolean supportsLetterToSound, Boolean supportsMarkup, Voice[] voices)
SynthesizerMode
with the specified mode features.
Sets engineName
, modeName
, running
,
supportsLetterToSound
, and supportsMarkup
all to the specified values.
Any parameter may be null
to signify "don't care".
The order of the Voice
s determines their preference order.
engineName
- the desired engine namemodeName
- the desired mode namerunning
- a flag specifying a running enginesupportsLetterToSound
- a flag specifying letter to sound supportsupportsMarkup
- a flag specifying markup supportvoices
- the desired set of Voice
sgetEngineName
,
getModeName
,
getRunning
,
getSupportsLetterToSound
,
getSupportsMarkup
,
getVoices
,
Voice
,
match
Method Detail |
---|
public boolean equals(Object mode)
true
if and only if the mode
parameter
is not null
and has equal values of all
mode features with this EngineMode
.
equals
in class EngineMode
mode
- an EngineMode
to compare
true
if mode
equals
this EngineMode
public Boolean getSupportsMarkup()
Engine
that supports markup can properly interpret
markup passed to the Engine
(true
).
Some Engine
s do not expect to receive markup at all
(false
).
In an application-generated EngineMode
,
a null
value means "don't care".
An Engine
-generated EngineMode
never
returns null
.
The class description describes how features may be used to
select an Engine
or request information about
a specific Engine
.
When this feature is false
for a Synthesizer
,
the speakMarkup
and speak
methods that accept
markup will ignore the markup when called and render the associated
text as plain text.
getSupportsMarkup
in class EngineMode
speak
,
speakMarkup
public Voice[] getVoices()
Voice
s specified
in this SynthesizerMode
.
Synthesizer
s use the order of the list as a preference order to
select Voice
s.
In application generated EngineMode
s,
a null
value means "don't care".
Engine
generated EngineMode
s never
return null
values.
The EngineManager
class describes how features may be used to
select an Engine
or request information about
a specific Engine
.
Voice
spublic int hashCode()
hashCode
in class EngineMode
public boolean match(EngineMode require)
SynthesizerMode
has all the features
specified by the require
object.
Features in require
which are null
are not tested.
All String comparisons are exact (case-sensitive).
The parameters are used as follows:
EngineMode
class are compared.
If any test fails, the method returns false
.
require
parameter is a
SynthesizerMode
(or sub-class)
then the require
d Voice
list is tested as follows.
Each Voice
defined in the require
d set must match
one of the Voice
s in the tested object.
Voice.match
describes details on
Voice
matching.
Note that it is possible to compare an EngineMode
against a
SynthesizerMode
and vice versa.
match
in class EngineMode
require
- the SynthesizerMode
to match against
true
if all the specified features in require
matchVoice
,
Voice.match
public String toString()
String
representation of this SynthesizerMode
.
The exact details of the representation are unspecified and subject to change.
toString
in class EngineMode
String
representation of this SynthesizerMode
|
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.