Overview | Package | Class | Tree | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Synthesizer
.
The SynthesizerProperties
object is obtained by
calling the getEngineProperties
method of the
Synthesizer
(inherited from the Engine
interface).
Because SynthesizerProperties
extends the
EngineProperties
interface to provide synthesizer-specific
properties. It also inherits the following properties and
conventions from the EngineProperties
interface.
Engine
will apply a change as soon as possible. A PropertyChangeEvent
is issued when the change takes effect. For example, a change
in the speaking rate might take place immediately, or at the
end of the current word, sentence or paragraph.
PropertyChangeListener
may be attached to
receive property change events.
A change in voice may lead to change in other properties.
For example, female and young voices typically have higher
pitches than male voices. When a change in voice leads to
changes in other properties, a separate PropertyChangeEvent
is issued for each property changed.
Whenever possible, property changes should be persistent for a voice. For instance, after changing from voice A to voice B and back, the previous property settings for voice A should return.
Changes in pitch, speaking rate and so on in the Java Speech Markup Language
text provided to the synthesizer affect the get values but
do not lead to a property change event. Applications needing an
event at the time these changes should include a MARK
property with the appropriate JSML element.
Method Summary | |
float | getPitchRange()
Get the pitch range for synthesis. |
float | getPitch()
Get the baseline pitch for synthesis. |
float | getSpeakingRate()
Get the current target speaking rate. |
Voice | getVoice()
Get the current synthesizer voice. |
float | getVolume()
Get the current volume. |
void | setPitchRange(float hertz)
Set the pitch range for the current synthesis voice. |
void | setPitch(float hertz)
Set the baseline pitch for the current synthesis voice. |
void | setSpeakingRate(float wpm)
Set the target speaking rate for the synthesis voice in words per minute. |
void | setVoice(Voice voice)
Set the current synthesizer voice. |
void | setVolume(float volume)
Set the volume for the synthesizer's speech output as a value between 0.0 and 1.0. A value of 0.0 indicates silence. |
Method Detail |
public Voice getVoice()
Synthesizer
voice - a call
to setVoice
is required for a change to take effect.
public void setVoice(Voice voice) throws PropertyVetoException
The list of available voices for a Synthesizer
is returned by the getVoices method of the synthesizer's
SynthesizerModeDesc
. Any one of the voices
returned by that method can be passed to setVoice
to set the current speaking voice.
Alternatively, the voice parameter may be an application-created
partially specified Voice
object.
If there is no matching voice, the call is ignored.
For example, to select a young female voice:
Voice voice = new Voice(null GENDER_FEMALE, AGE_CHILD | AGE_TEENAGER, null); synthesizerProperties.setVoice(voice);
public float getPitch()
public void setPitch(float hertz) throws PropertyVetoException
public float getPitchRange()
public void setPitchRange(float hertz) throws PropertyVetoException
The pitch range is typically between 20% and 80% of the baseline pitch.
public float getSpeakingRate()
public void setSpeakingRate(float wpm) throws PropertyVetoException
Reasonable speaking rates depend upon the synthesizer and the current voice (some voices sound better at higher or lower speed than others).
Speaking rate is also dependent upon the language because of different conventions for what is a "word". A reasonable speaking rate for English is 200 words per minute.
public float getVolume()
public void setVolume(float volume) throws PropertyVetoException
A synthesizer may change the voice's style with volume. For example, a quiet volume might produce whispered output and loud might produce shouting. Most synthesizer do not make this type of change.
Overview | Package | Class | Tree | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Speech API
Copyright 1997-1998 Sun Microsystems, Inc. All rights reserved
Send comments to javaspeech-comments@sun.com