Package com.sun.speech.engine.synthesis
Class VoiceList
java.lang.Object
com.sun.speech.engine.synthesis.VoiceList
Maintains a list of JSAPI 1.0
Voices
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a voice to the list.getVoiceById
(String id) Gets a voice by its identifier.getVoiceId
(String name, int gender, int age, int variant) Gets id for voice based on parameters provided in JSML.getVoiceId
(Voice voice, int variant) Gets the id of a voice.void
removeVoice
(BaseVoice voice) Removes a voice from the list.
-
Field Details
-
voiceList
The list ofVoices
.
-
-
Constructor Details
-
VoiceList
public VoiceList()Class constructor. -
VoiceList
public VoiceList(SynthesizerModeDesc desc) Constructs from the voice list indesc
. Requires that all voices in mode desc be instances ofBaseVoice
.- Parameters:
desc
- theSynthesizerModeDesc
to get voices from
-
-
Method Details
-
addVoice
Adds a voice to the list.- Parameters:
voice
- the voice to add- See Also:
-
removeVoice
Removes a voice from the list.- Parameters:
voice
- the voice to remove- See Also:
-
getVoiceById
Gets a voice by its identifier.- Parameters:
id
- the voice id- Returns:
- the voice if it exists; otherwise
null
- See Also:
-
getVoiceId
Gets the id of a voice.- Parameters:
voice
- the voicevariant
- the voice variant- Returns:
- the id of the voice
-
getVoiceId
Gets id for voice based on parameters provided in JSML. Priority to voice name. Then try to match age and gender plus variant.- Parameters:
name
- the voice namegender
- the genderage
- the agevariant
- the variant- Returns:
- the voice id
- See Also:
-
BaseVoice
Voice
-