Package com.sun.speech.freetts
Class FreeTTS
java.lang.Object
com.sun.speech.freetts.FreeTTS
- Direct Known Subclasses:
FreeTTSTime
Standalone utility that directly interacts with a CMUDiphoneVoice.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
fileToSpeech
(String filePath) Converts the text contained in the given path to speech.Returns the InputMode.boolean
Gets silent mode.protected Voice
getVoice()
Returns the voice used by FreeTTS.static void
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
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.
-
Field Details
-
VERSION
Version number.- See Also:
-
-
Constructor Details
-
FreeTTS
public FreeTTS()Constructs a default FreeTTS with the kevin16 voice. -
FreeTTS
Creates a FreeTTS object with the given Voice.- Parameters:
voice
- the voice to use
-
-
Method Details
-
startup
public void startup()Starts this FreeTTS Synthesizer by loading the void and creating a new AudioPlayer. -
shutdown
public void shutdown()Shuts down this FreeTTS synthesizer by closing the AudioPlayer and voice. -
textToSpeech
Converts the given text to speech based using processing options currently set in FreeTTS.- Parameters:
text
- the text to speak- Returns:
- true if the utterance was played properly
-
getVoice
Returns the voice used by FreeTTS.- Returns:
- the voice used by freetts
-
streamToSpeech
Converts the text contained in the given stream to speech.- Parameters:
is
- the stream containing the text to speak
-
urlToSpeech
Converts the text contained in the given path to speech.- Parameters:
urlPath
- the file containing the text to speak- Returns:
- true if the utterance was played properly
-
fileToSpeech
Converts the text contained in the given path to speech.- Parameters:
filePath
- the file containing the text to speak- Returns:
- true if the utterance was played properly
-
setSilentMode
public void setSilentMode(boolean silent) Turns audio playing on and off.- Parameters:
silent
- if true, don't play audio
-
getSilentMode
public boolean getSilentMode()Gets silent mode.- Returns:
- true if in silent mode
- See Also:
-
setInputMode
Sets the input mode.- Parameters:
inputMode
- the input mode
-
getInputMode
Returns the InputMode.- Returns:
- the input mode
- See Also:
-
setAudioFile
Sets the audio file .- Parameters:
audioFile
- the audioFile
-
setMultiAudio
public void setMultiAudio(boolean multiAudio) Sets multi audio. If true, and an audio file has been set output will be sent to multiple files- Parameters:
multiAudio
- iftrue
send output to multiple files.
-
setStreamingAudio
public void setStreamingAudio(boolean streamingAudio) Sets streaming audio. If true, output will be sent to- Parameters:
streamingAudio
- iftrue
stream audio
-
main
The main entry point for FreeTTS.
-