/* Create a template that tells JSAPI what kind of speech
* synthesizer we are interested in. In this case, we're
* just looking for a general domain synthesizer for US
* English.
*/
SynthesizerModeDesc required = new SynthesizerModeDesc(
null, // engine name
modeName, // mode name
Locale.US, // locale
null, // running
null); // voices
/* Contact the primary entry point for JSAPI, which is
* the Central class, to discover what synthesizers are
* available that match the template we defined above.
*/
EngineList engineList = Central.availableSynthesizers(required);
for (int i = 0; i < engineList.size(); i++) {
SynthesizerModeDesc desc = (SynthesizerModeDesc) engineList.get(i);
System.out.println(" " + desc.getEngineName()
+ " (mode=" + desc.getModeName()
+ ", locale=" + desc.getLocale() + "):");
Voice[] voices = desc.getVoices();
for (int j = 0; j < voices.length; j++) {
System.out.println(" " + voices[j].getName());
}
}
}