July 2017
Beginner to intermediate
715 pages
17h 3m
English
The VoiceManager class' getVoices method is used to obtain an array of the voices currently available. This can be useful to provide users with a list of voices to choose from. We will use the method here to illustrate some of the voices available. In the next code sequence, the method returns the array, whose elements are then displayed:
Voice[] voices = voiceManager.getVoices(); for (Voice v : voices) { out.println(v); }
The output will be similar to the following:
CMUClusterUnitVoiceCMUDiphoneVoiceCMUDiphoneVoiceMbrolaVoiceMbrolaVoiceMbrolaVoice
The getVoiceInfo method provides potentially more useful information, though it is somewhat verbose:
out.println(voiceManager.getVoiceInfo());
The first ...
Read now
Unlock full access