3 Replies Latest reply: Oct 22, 2010 12:16 AM by EJP RSS

    java speech api

      kindly suggest me where to get the java speech api
        • 1. Re: java speech api
          Java Speech is a specification and there are many implementations of it by different other people. one of it is FreeTTS.
          You can download it from
          • 2. Re: java speech api
            import javax.speech.*;
            import javax.speech.synthesis.*;
            import java.util.Locale;
            import java.util.*;
            import java.util.Scanner;
            public class HelloWorld {
                 public static void main(String args[]) {
                      String str = "";
                      System.out.print("Input Text: ");
                      Scanner input = new Scanner(System.in);
                      str = input.nextLine();
                      try {
                           System.setProperty("freetts.voices", "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
                      // Create a synthesizer for English
                           Synthesizer synth = Central.createSynthesizer(
                           new SynthesizerModeDesc(Locale.ENGLISH));
                      // Get it ready to speak
                      // Speak the “Hello world” string
                           synth.speakPlainText(str, null);
                      // Wait till speaking is done
                      // Clean up
                      catch (Exception e) {
            Here's a sample program using FreeTTS.
            1.Download FreeTTS from sourceforge.
            2.Extract files to some folder.
            3.Go to lib folder run jsapi.exe (it should extract jsapi.jar)
            4.Copy all jar file from lib directory to your java directory mine was C:\Program Files\Java\jdk1.6.0_22\jre\lib\ext
            5.compile then run the program.

            Edited by: Darryl Burke -- code tags added
            • 3. Re: java speech api
              You are four years late. Locking.