Package com.sun.speech.engine.synthesis
Class BaseVoice
- java.lang.Object
-
- Voice
-
- com.sun.speech.engine.synthesis.BaseVoice
-
- Direct Known Subclasses:
FreeTTSVoice
public class BaseVoice extends VoiceExtends the JSAPI 1.0Voiceclass to encapsulate engine-specific data.
-
-
Field Summary
Fields Modifier and Type Field Description protected floatdefaultPitchThe default pitchprotected floatdefaultPitchRangeThe default pitch rangeprotected floatdefaultSpeakingRateThe default speaking rateprotected floatdefaultVolumeThe default volumeprotected java.lang.StringvoiceIdThe id of the voice
-
Constructor Summary
Constructors Constructor Description BaseVoice(java.lang.String id, java.lang.String name, int gender, int age, java.lang.String style, float pitch, float pitchRange, float speakingRate, float volume)Class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Creates a copy of this voice.java.lang.StringgetId()Gets the id for this voice.floatgetPitch()Gets the pitch for this voicefloatgetPitchRange()Gets the pitch range for this voicefloatgetSpeakingRate()Gets the speaking rate for this voicefloatgetVolume()Gets the volume for this voicevoidsetId(java.lang.String id)Sets the id for this voice.java.lang.StringtoString()Converts a Voice to a printable string.
-
-
-
Field Detail
-
voiceId
protected java.lang.String voiceId
The id of the voice
-
defaultPitch
protected float defaultPitch
The default pitch
-
defaultPitchRange
protected float defaultPitchRange
The default pitch range
-
defaultSpeakingRate
protected float defaultSpeakingRate
The default speaking rate
-
defaultVolume
protected float defaultVolume
The default volume
-
-
Constructor Detail
-
BaseVoice
public BaseVoice(java.lang.String id, java.lang.String name, int gender, int age, java.lang.String style, float pitch, float pitchRange, float speakingRate, float volume)Class constructor. The age and gender parameters are defined inVoice.- Parameters:
id- the idname- the namegender- the genderage- the agestyle- the stylepitch- the baseline pitch in HertzpitchRange- the pitch range in HertzspeakingRate- the speaking rate in words per minutevolume- the volume expressed between 0.0 and 1.0, inclusive
-
-
Method Detail
-
getId
public java.lang.String getId()
Gets the id for this voice. Should be unique for a synthesizer.- Returns:
- the id for this voice
- See Also:
setId(java.lang.String)
-
setId
public void setId(java.lang.String id)
Sets the id for this voice.- Parameters:
id- the new id- See Also:
getId()
-
getPitch
public float getPitch()
Gets the pitch for this voice- Returns:
- the pitch
-
getPitchRange
public float getPitchRange()
Gets the pitch range for this voice- Returns:
- the pitch range
-
getSpeakingRate
public float getSpeakingRate()
Gets the speaking rate for this voice- Returns:
- the speaking rate
-
getVolume
public float getVolume()
Gets the volume for this voice- Returns:
- the volume
-
clone
public java.lang.Object clone()
Creates a copy of this voice.- Returns:
- a clone of this voice
-
toString
public java.lang.String toString()
Converts a Voice to a printable string.
-
-