Java Speech API

R

ro001

Hi i found the code below on Java.Sun and i have read about different
speech engines like Freetts that develop the Java Speech API.

But i still can not get to comple the following code as the 3 packages
declared can not be found?

Could anyone be so kind as to tell me what i need to install in oder to
use these packages??!!

cheers and thanks for any replys!


import javax.speech.*;
import javax.speech.synthesis.*;
import java.util.Locale;

public class HelloWorld {
public static void main(String args[]) {
try {
// Create a synthesizer for English
Synthesizer synth = Central.createSynthesizer(
new SynthesizerModeDesc(Locale.ENGLISH));

// Get it ready to speak
synth.allocate();
synth.resume();

// Speak the "Hello world" string
synth.speakPlainText("Hello, world!", null);

// Wait till speaking is done
synth.waitEngineState(Synthesizer.QUEUE_EMPTY);

// Clean up
synth.deallocate();
} catch (Exception e) {
e.printStackTrace();
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Text to Speech 0
java speech implementation 0
java mail api 3
Java Midi Synthesizer 2
Java API sound 19
Java Persistence API and persistence.xml 2
J2SE Bluetooth and java comm API 11
Text To Speech with pyTTS 6

Members online

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top