public class VoiceManager
extends java.lang.Object
Voice
,
VoiceDirectory
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String voiceName)
Check if there is a voice provides with the given name.
|
static VoiceManager |
getInstance()
Gets the instance of the VoiceManager
|
Voice |
getVoice(java.lang.String voiceName)
Get a Voice with a given name.
|
static java.net.URLClassLoader |
getVoiceClassLoader()
Gets the class loader used for loading dynamically detected jars.
|
java.lang.String |
getVoiceInfo()
Prints detailed information about all available voices.
|
Voice[] |
getVoices()
Provide an array of all voices available to FreeTTS.
|
java.lang.String |
toString()
Provides a string representation of all voices available to FreeTTS.
|
public static VoiceManager getInstance()
public Voice[] getVoices()
Second, the file internal_voices.txt is looked for in the same directory as VoiceManager.class. If the file does not exist, the VoiceManager moves on. Next, it looks for voices.txt in the same directory as freetts.jar. If the file does not exist, the VoiceManager moves on. Next, if the property "freetts.voicesfile" is defined, then that file is read in. If the property is defined and the file does not exist, then an error is raised.
Every voices file that is read in contains a list of VoiceDirectory class names.
Next, the voice manager looks for freetts voice jarfiles that may exist in well-known locations. The directory that contains freetts.jar is searched for voice jarfiles, then directories specified by the "freetts.voicespath" system property. Any jarfile whose Manifest contains "FreeTTSVoiceDefinition: true" is assumed to be a FreeTTS voice, and the Manifest's "Main-Class" entry is assumed to be the name of the voice directory. The dependencies of the voice jarfiles specified by the "Class-Path" Manifest entry are also loaded.
The VoiceManager instantiates each voice directory and calls getVoices() on each.
public java.lang.String getVoiceInfo()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean contains(java.lang.String voiceName)
voiceName
- the name of the voice to checkpublic Voice getVoice(java.lang.String voiceName)
voiceName
- the name of the voice to get.public static java.net.URLClassLoader getVoiceClassLoader()