com.sun.speech.engine.synthesis
Class BaseSynthesizerProperties

java.lang.Object
  extended bycom.sun.speech.engine.BaseEngineProperties
      extended bycom.sun.speech.engine.synthesis.BaseSynthesizerProperties
All Implemented Interfaces:
javax.speech.EngineProperties, SpeechEventDispatcher, javax.speech.synthesis.SynthesizerProperties

public class BaseSynthesizerProperties
extends BaseEngineProperties
implements javax.speech.synthesis.SynthesizerProperties

Supports the JSAPI 1.0 SynthesizerProperties interface. The properties of a Synthesizer are:


Field Summary
protected  float currentPitch
          The current pitch.
protected  float currentPitchRange
          The current pitch range.
protected  float currentSpeakingRate
          The current speaking rate.
protected  javax.speech.synthesis.Voice currentVoice
          The current voice.
protected  float currentVolume
          The current volume.
protected  float defaultPitch
          The default pitch.
protected  float defaultPitchRange
          The default pitch range.
protected  float defaultSpeakingRate
          The default specking rate.
protected  javax.speech.synthesis.Voice defaultVoice
          The default voice.
protected  float defaultVolume
          The default volume.
 
Fields inherited from class com.sun.speech.engine.BaseEngineProperties
propertyChangeListeners
 
Constructor Summary
BaseSynthesizerProperties()
          Class constructor.
BaseSynthesizerProperties(javax.speech.synthesis.Voice defaultVoice, float defaultPitch, float defaultPitchRange, float defaultSpeakingRate, float defaultVolume)
          Creates a new BaseSynthesizerProperties with the given default values.
 
Method Summary
 float getPitch()
          Gets the baseline pitch for synthesis.
 float getPitchRange()
          Gets the pitch range for synthesis.
 float getSpeakingRate()
          Gets the current target speaking rate in words per minute.
 javax.speech.synthesis.Voice getVoice()
          Gets the current synthesizer voice.
 float getVolume()
          Gets the current volume.
 void reset()
          Resets all properties to their default values.
 void setPitch(float hertz)
          Sets the baseline pitch for the current synthesis voice.
 void setPitchRange(float hertz)
          Sets the pitch range for the current synthesis voice.
 void setSpeakingRate(float wpm)
          Sets the target speaking rate in words per minute.
 void setVoice(javax.speech.synthesis.Voice voice)
          Sets the current synthesizer voice.
 void setVolume(float volume)
          Sets the volume.
 
Methods inherited from class com.sun.speech.engine.BaseEngineProperties
addPropertyChangeListener, dispatchSpeechEvent, firePropertyChangeEvent, getControlComponent, postPropertyChangeEvent, postPropertyChangeEvent, postPropertyChangeEvent, postPropertyChangeEvent, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.speech.EngineProperties
addPropertyChangeListener, getControlComponent, removePropertyChangeListener
 

Field Detail

defaultVoice

protected javax.speech.synthesis.Voice defaultVoice
The default voice.


defaultPitch

protected float defaultPitch
The default pitch.


defaultPitchRange

protected float defaultPitchRange
The default pitch range.


defaultSpeakingRate

protected float defaultSpeakingRate
The default specking rate.


defaultVolume

protected float defaultVolume
The default volume.


currentVoice

protected javax.speech.synthesis.Voice currentVoice
The current voice.


currentPitch

protected float currentPitch
The current pitch.


currentPitchRange

protected float currentPitchRange
The current pitch range.


currentSpeakingRate

protected float currentSpeakingRate
The current speaking rate.


currentVolume

protected float currentVolume
The current volume.

Constructor Detail

BaseSynthesizerProperties

public BaseSynthesizerProperties()
Class constructor.


BaseSynthesizerProperties

public BaseSynthesizerProperties(javax.speech.synthesis.Voice defaultVoice,
                                 float defaultPitch,
                                 float defaultPitchRange,
                                 float defaultSpeakingRate,
                                 float defaultVolume)
Creates a new BaseSynthesizerProperties with the given default values.

Parameters:
defaultVoice - the default voice
defaultPitch - the default pitch
defaultPitchRange - the default pitch range
defaultSpeakingRate - the default speaking rate
defaultVolume - the default volume
Method Detail

reset

public void reset()
Resets all properties to their default values.

Specified by:
reset in interface javax.speech.EngineProperties
Specified by:
reset in class BaseEngineProperties

getVoice

public javax.speech.synthesis.Voice getVoice()
Gets the current synthesizer voice.

Specified by:
getVoice in interface javax.speech.synthesis.SynthesizerProperties
Returns:
the current synthesizer voice.
See Also:
setVoice(javax.speech.synthesis.Voice)

setVoice

public void setVoice(javax.speech.synthesis.Voice voice)
              throws java.beans.PropertyVetoException
Sets the current synthesizer voice.

Specified by:
setVoice in interface javax.speech.synthesis.SynthesizerProperties
Parameters:
voice - the new voice
Throws:
java.beans.PropertyVetoException - if the voice cannot be set to the given value
See Also:
getVoice()

getPitch

public float getPitch()
Gets the baseline pitch for synthesis.

Specified by:
getPitch in interface javax.speech.synthesis.SynthesizerProperties
Returns:
the baseline pitch in Hertz
See Also:
setPitch(float)

setPitch

public void setPitch(float hertz)
              throws java.beans.PropertyVetoException
Sets the baseline pitch for the current synthesis voice.

Specified by:
setPitch in interface javax.speech.synthesis.SynthesizerProperties
Parameters:
hertz - the new baseline pitch in Hertz
Throws:
java.beans.PropertyVetoException - if the baseline pitch cannot be set to the given value
See Also:
getPitch()

getPitchRange

public float getPitchRange()
Gets the pitch range for synthesis.

Specified by:
getPitchRange in interface javax.speech.synthesis.SynthesizerProperties
Returns:
the current pitch range in Hertz
See Also:
setPitchRange(float)

setPitchRange

public void setPitchRange(float hertz)
                   throws java.beans.PropertyVetoException
Sets the pitch range for the current synthesis voice.

Specified by:
setPitchRange in interface javax.speech.synthesis.SynthesizerProperties
Parameters:
hertz - the new range in Hertz
Throws:
java.beans.PropertyVetoException - if the pitch range cannot be set to the given value
See Also:
getPitchRange()

getSpeakingRate

public float getSpeakingRate()
Gets the current target speaking rate in words per minute.

Specified by:
getSpeakingRate in interface javax.speech.synthesis.SynthesizerProperties
Returns:
the current target speaking rate in words per minute.
See Also:
getSpeakingRate()

setSpeakingRate

public void setSpeakingRate(float wpm)
                     throws java.beans.PropertyVetoException
Sets the target speaking rate in words per minute.

Specified by:
setSpeakingRate in interface javax.speech.synthesis.SynthesizerProperties
Parameters:
wpm - the new speaking rate in words per minute
Throws:
java.beans.PropertyVetoException - if the speaking rate cannot be set to the given value
See Also:
getSpeakingRate()

getVolume

public float getVolume()
Gets the current volume.

Specified by:
getVolume in interface javax.speech.synthesis.SynthesizerProperties
Returns:
the current volume expressed as a float 0.0 and 1.0, inclusive
See Also:
setVolume(float)

setVolume

public void setVolume(float volume)
               throws java.beans.PropertyVetoException
Sets the volume.

Specified by:
setVolume in interface javax.speech.synthesis.SynthesizerProperties
Parameters:
volume - the new volume expressed as a float 0.0 and 1.0, inclusive
Throws:
java.beans.PropertyVetoException - if the volume cannot be set to the given value
See Also:
getVolume()