Posts

Showing posts from 2013

FreeTTS Hello World Java Maven

After spending too much time trying to get text to speech (tts) to work and seeing others struggle as well I decided to capture what worked for me. You can checkout the code on github https://github.com/geoinline/textToSpeech , or you can just copy and paste the below code and get hello world working! java code... import java.beans.PropertyVetoException; import java.util.Locale; import javax.speech.AudioException; import javax.speech.Central; import javax.speech.EngineException; import javax.speech.EngineStateError; import javax.speech.synthesis.Synthesizer; import javax.speech.synthesis.SynthesizerModeDesc; import javax.speech.synthesis.Voice; public class SpeechUtils { SynthesizerModeDesc desc; Synthesizer synthesizer; Voice voice; public void init(String voiceName) throws EngineException, AudioException, EngineStateError, PropertyVetoException { if (desc == null) { System.setProperty("freetts.voices",