Package com.sun.speech.engine.synthesis
Class BaseSynthesizerProperties
- java.lang.Object
-
- com.sun.speech.engine.BaseEngineProperties
-
- com.sun.speech.engine.synthesis.BaseSynthesizerProperties
-
- All Implemented Interfaces:
SpeechEventDispatcher
public class BaseSynthesizerProperties extends BaseEngineProperties
Supports the JSAPI 1.0SynthesizerPropertiesinterface. The properties of aSynthesizerare:- Speaking voice,
- Baseline pitch,
- Pitch range,
- Speaking rate,
- Volume.
-
-
Field Summary
Fields Modifier and Type Field Description protected floatcurrentPitchThe current pitch.protected floatcurrentPitchRangeThe current pitch range.protected floatcurrentSpeakingRateThe current speaking rate.protected VoicecurrentVoiceThe current voice.protected floatcurrentVolumeThe current volume.protected floatdefaultPitchThe default pitch.protected floatdefaultPitchRangeThe default pitch range.protected floatdefaultSpeakingRateThe default specking rate.protected VoicedefaultVoiceThe default voice.protected floatdefaultVolumeThe default volume.-
Fields inherited from class com.sun.speech.engine.BaseEngineProperties
propertyChangeListeners
-
-
Constructor Summary
Constructors Constructor Description BaseSynthesizerProperties()Class constructor.BaseSynthesizerProperties(Voice defaultVoice, float defaultPitch, float defaultPitchRange, float defaultSpeakingRate, float defaultVolume)Creates a newBaseSynthesizerPropertieswith the given default values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetPitch()Gets the baseline pitch for synthesis.floatgetPitchRange()Gets the pitch range for synthesis.floatgetSpeakingRate()Gets the current target speaking rate in words per minute.VoicegetVoice()Gets the current synthesizer voice.floatgetVolume()Gets the current volume.voidreset()Resets all properties to their default values.voidsetPitch(float hertz)Sets the baseline pitch for the current synthesis voice.voidsetPitchRange(float hertz)Sets the pitch range for the current synthesis voice.voidsetSpeakingRate(float wpm)Sets the target speaking rate in words per minute.voidsetVoice(Voice voice)Sets the current synthesizer voice.voidsetVolume(float volume)Sets the volume.-
Methods inherited from class com.sun.speech.engine.BaseEngineProperties
addPropertyChangeListener, dispatchSpeechEvent, firePropertyChangeEvent, getControlComponent, postPropertyChangeEvent, postPropertyChangeEvent, postPropertyChangeEvent, postPropertyChangeEvent, removePropertyChangeListener
-
-
-
-
Field Detail
-
defaultVoice
protected 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 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(Voice defaultVoice, float defaultPitch, float defaultPitchRange, float defaultSpeakingRate, float defaultVolume)Creates a newBaseSynthesizerPropertieswith the given default values.- Parameters:
defaultVoice- the default voicedefaultPitch- the default pitchdefaultPitchRange- the default pitch rangedefaultSpeakingRate- the default speaking ratedefaultVolume- the default volume
-
-
Method Detail
-
reset
public void reset()
Resets all properties to their default values.- Specified by:
resetin classBaseEngineProperties
-
getVoice
public Voice getVoice()
Gets the current synthesizer voice.- Returns:
- the current synthesizer voice.
- See Also:
setVoice(Voice)
-
setVoice
public void setVoice(Voice voice) throws java.beans.PropertyVetoExceptionSets the current synthesizer voice.- 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.- Returns:
- the baseline pitch in Hertz
- See Also:
setPitch(float)
-
setPitch
public void setPitch(float hertz) throws java.beans.PropertyVetoExceptionSets the baseline pitch for the current synthesis voice.- 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.- Returns:
- the current pitch range in Hertz
- See Also:
setPitchRange(float)
-
setPitchRange
public void setPitchRange(float hertz) throws java.beans.PropertyVetoExceptionSets the pitch range for the current synthesis voice.- 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.- Returns:
- the current target speaking rate in words per minute.
- See Also:
getSpeakingRate()
-
setSpeakingRate
public void setSpeakingRate(float wpm) throws java.beans.PropertyVetoExceptionSets the target speaking rate in words per minute.- 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.- Returns:
- the current volume expressed as a
float0.0 and 1.0, inclusive - See Also:
setVolume(float)
-
setVolume
public void setVolume(float volume) throws java.beans.PropertyVetoExceptionSets the volume.- Parameters:
volume- the new volume expressed as afloat0.0 and 1.0, inclusive- Throws:
java.beans.PropertyVetoException- if the volume cannot be set to the given value- See Also:
getVolume()
-
-