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
Supports the JSAPI 1.0
SynthesizerProperties
interface. The properties of a Synthesizer are:
- Speaking voice,
- Baseline pitch,
- Pitch range,
- Speaking rate,
- Volume.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatThe current pitch.protected floatThe current pitch range.protected floatThe current speaking rate.protected VoiceThe current voice.protected floatThe current volume.protected floatThe default pitch.protected floatThe default pitch range.protected floatThe default specking rate.protected VoiceThe default voice.protected floatThe default volume.Fields inherited from class com.sun.speech.engine.BaseEngineProperties
propertyChangeListeners -
Constructor Summary
ConstructorsConstructorDescriptionClass constructor.BaseSynthesizerProperties(Voice defaultVoice, float defaultPitch, float defaultPitchRange, float defaultSpeakingRate, float defaultVolume) Creates a newBaseSynthesizerPropertieswith the given default values. -
Method Summary
Modifier and TypeMethodDescriptionfloatgetPitch()Gets the baseline pitch for synthesis.floatGets the pitch range for synthesis.floatGets the current target speaking rate in words per minute.VoicegetVoice()Gets the current synthesizer voice.floatGets 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 Details
-
defaultVoice
protected Voice defaultVoiceThe default voice. -
defaultPitch
protected float defaultPitchThe default pitch. -
defaultPitchRange
protected float defaultPitchRangeThe default pitch range. -
defaultSpeakingRate
protected float defaultSpeakingRateThe default specking rate. -
defaultVolume
protected float defaultVolumeThe default volume. -
currentVoice
protected Voice currentVoiceThe current voice. -
currentPitch
protected float currentPitchThe current pitch. -
currentPitchRange
protected float currentPitchRangeThe current pitch range. -
currentSpeakingRate
protected float currentSpeakingRateThe current speaking rate. -
currentVolume
protected float currentVolumeThe current volume.
-
-
Constructor Details
-
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 Details
-
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
Sets the current synthesizer voice.- Parameters:
voice- the new voice- Throws:
PropertyVetoException- if the voice cannot be set to the given value- See Also:
-
getPitch
public float getPitch()Gets the baseline pitch for synthesis.- Returns:
- the baseline pitch in Hertz
- See Also:
-
setPitch
Sets the baseline pitch for the current synthesis voice.- Parameters:
hertz- the new baseline pitch in Hertz- Throws:
PropertyVetoException- if the baseline pitch cannot be set to the given value- See Also:
-
getPitchRange
public float getPitchRange()Gets the pitch range for synthesis.- Returns:
- the current pitch range in Hertz
- See Also:
-
setPitchRange
Sets the pitch range for the current synthesis voice.- Parameters:
hertz- the new range in Hertz- Throws:
PropertyVetoException- if the pitch range cannot be set to the given value- See Also:
-
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:
-
setSpeakingRate
Sets the target speaking rate in words per minute.- Parameters:
wpm- the new speaking rate in words per minute- Throws:
PropertyVetoException- if the speaking rate cannot be set to the given value- See Also:
-
getVolume
public float getVolume()Gets the current volume.- Returns:
- the current volume expressed as a
float0.0 and 1.0, inclusive - See Also:
-
setVolume
Sets the volume.- Parameters:
volume- the new volume expressed as afloat0.0 and 1.0, inclusive- Throws:
PropertyVetoException- if the volume cannot be set to the given value- See Also:
-