public class FreeTTS extends Object
Modifier and Type | Field and Description |
---|---|
private String |
audioFile |
private static AudioPlayer |
audioPlayer |
private InputMode |
inputMode |
private static Logger |
LOGGER
Logger instance.
|
private boolean |
multiAudio |
private boolean |
silent |
private boolean |
streamingAudio |
static String |
VERSION
Version number.
|
private Voice |
voice |
Constructor and Description |
---|
FreeTTS()
Constructs a default FreeTTS with the kevin16 voice.
|
FreeTTS(Voice voice)
Creates a FreeTTS object with the given Voice.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
batchTextToSpeech(String text)
Converts the given text to speech based using processing options
currently set in FreeTTS.
|
private static void |
dumpAudioTypes()
Dumps the possible audio output file types
|
boolean |
fileToSpeech(String filePath)
Converts the text contained in the given path to speech.
|
private AudioFileFormat.Type |
getAudioType(String file)
Returns the audio type based upon the extension of the given file
|
private static String |
getBasename(String path)
Given a filename returns the basename for the file
|
private static String |
getExtension(String path)
Given a filename returns the extension for the file
|
InputMode |
getInputMode()
Returns the InputMode.
|
boolean |
getSilentMode()
Gets silent mode.
|
protected Voice |
getVoice()
Returns the voice used by FreeTTS.
|
private static void |
interactiveMode(FreeTTS freetts)
Starts interactive mode on the given FreeTTS.
|
private boolean |
lineToSpeech(String path)
Reads the file pointed to by the given path and renders each line as
speech individually.
|
static void |
main(String[] args)
The main entry point for FreeTTS.
|
void |
setAudioFile(String audioFile)
Sets the audio file .
|
void |
setInputMode(InputMode inputMode)
Sets the input mode.
|
void |
setMultiAudio(boolean multiAudio)
Sets multi audio.
|
void |
setSilentMode(boolean silent)
Turns audio playing on and off.
|
void |
setStreamingAudio(boolean streamingAudio)
Sets streaming audio.
|
void |
shutdown()
Shuts down this FreeTTS synthesizer by closing the AudioPlayer and voice.
|
void |
startup()
Starts this FreeTTS Synthesizer by loading the void and creating a new
AudioPlayer.
|
boolean |
streamToSpeech(InputStream is)
Converts the text contained in the given stream to speech.
|
boolean |
textToSpeech(String text)
Converts the given text to speech based using processing options
currently set in FreeTTS.
|
boolean |
urlToSpeech(String urlPath)
Converts the text contained in the given path to speech.
|
(package private) static void |
usage(String voices)
Prints the usage message for FreeTTS.
|
public static final String VERSION
private static AudioPlayer audioPlayer
private boolean silent
private boolean multiAudio
private boolean streamingAudio
public FreeTTS()
public void startup()
private AudioFileFormat.Type getAudioType(String file)
file
- the file of interestprivate static String getExtension(String path)
path
- the path to extract the extension fromnull
if noneprivate static String getBasename(String path)
path
- the path to extract the basename frompublic void shutdown()
public boolean textToSpeech(String text)
text
- the text to speakprivate boolean batchTextToSpeech(String text)
text
- the text to speakprivate boolean lineToSpeech(String path)
protected Voice getVoice()
public boolean streamToSpeech(InputStream is)
is
- the stream containing the text to speakpublic boolean urlToSpeech(String urlPath)
urlPath
- the file containing the text to speakpublic boolean fileToSpeech(String filePath)
filePath
- the file containing the text to speakpublic void setSilentMode(boolean silent)
silent
- if true, don't play audiopublic boolean getSilentMode()
setSilentMode(boolean)
public void setInputMode(InputMode inputMode)
inputMode
- the input modepublic InputMode getInputMode()
setInputMode(com.sun.speech.freetts.InputMode)
public void setAudioFile(String audioFile)
audioFile
- the audioFilepublic void setMultiAudio(boolean multiAudio)
multiAudio
- if true
send output to multiple files.public void setStreamingAudio(boolean streamingAudio)
streamingAudio
- if true
stream audioprivate static void interactiveMode(FreeTTS freetts)
freetts
- the engineprivate static void dumpAudioTypes()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses