Package com.sun.speech.freetts

# Class FreeTTS

java.lang.Object
com.sun.speech.freetts.FreeTTS

Direct Known Subclasses:
  `FreeTTSTime`

public class FreeTTS extends Object
Standalone utility that directly interacts with a CMUDiphoneVoice.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`VERSION`
Version number.

## Constructor Summary

Constructors
Constructor
Description
`FreeTTS()`
Constructs a default FreeTTS with the kevin16 voice.
`FreeTTS(Voice voice)`
Creates a FreeTTS object with the given Voice.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`fileToSpeech(String filePath)`
Converts the text contained in the given path to speech.
`InputMode`
`getInputMode()`
Returns the InputMode.
`boolean`
`getSilentMode()`
Gets silent mode.
`protected Voice`
`getVoice()`
Returns the voice used by FreeTTS.
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### VERSION

public static final String VERSION
Version number.

See Also:
  - Constant Field Values

## Constructor Details

### FreeTTS

public FreeTTS()
Constructs a default FreeTTS with the kevin16 voice.

### FreeTTS

public FreeTTS(Voice voice)
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

public boolean textToSpeech(String text)
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

protected Voice getVoice()
Returns the voice used by FreeTTS.

Returns:
  the voice used by freetts

### streamToSpeech

public boolean streamToSpeech(InputStream is)
Converts the text contained in the given stream to speech.

Parameters:
  `is` - the stream containing the text to speak

### urlToSpeech

public boolean urlToSpeech(String urlPath)
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

public boolean fileToSpeech(String filePath)
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:
  - `setSilentMode(boolean)`

### setInputMode

public void setInputMode(InputMode inputMode)
Sets the input mode.

Parameters:
  `inputMode` - the input mode

### getInputMode

public InputMode getInputMode()
Returns the InputMode.

Returns:
  the input mode
See Also:
  - `setInputMode(com.sun.speech.freetts.InputMode)`

### setAudioFile

public void setAudioFile(String audioFile)
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` - if `true` send output to multiple files.

### setStreamingAudio

public void setStreamingAudio(boolean streamingAudio)
Sets streaming audio. If true, output will be sent to

Parameters:
  `streamingAudio` - if `true` stream audio

### main

public static void main(String[] args)
The main entry point for FreeTTS.