Java Speech Recognisation

Dear All,
I�m developing a speech recognizer cum synthesizer project. For that Im using sphinx4 as my recognizer and FreeTTS as synthesizer. Here[u] I need to know can I train my voice in sphinx 4. If yes pls help me.
I�ll be very glad if could find any solution for Heap space problem in Eclipse.
Are there any sites available with reference codes or full code for this?

follow the below links...
http://freetts.sourceforge.net/docs/index.php
http://freetts.sourceforge.net/docs/jsapi_setup.html

Similar Messages

  • Java Speech API

    Hi
    When i compile the following program it give me error some of the Java speech API.
    import javax.speech.AudioException;
    import javax.speech.Central;
    import javax.speech.EngineException;
    import javax.speech.synthesis.Synthesizer;
    import javax.speech.synthesis.SynthesizerModeDesc;
    Can any one help.
    Thanks
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.File;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.Locale;
    import java.util.Hashtable;
    import java.util.prefs.Preferences;
    import javax.speech.AudioException;
    import javax.speech.Central;
    import javax.speech.EngineException;
    import javax.speech.synthesis.Synthesizer;
    import javax.speech.synthesis.SynthesizerModeDesc;
    import javax.swing.DefaultComboBoxModel;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    import javax.swing.JTextArea;
    import javax.swing.JToolBar;
    public class JavaVoice extends JFrame implements Comparator {
         private Synthesizer synth;
         private File readFile = null;
         Preferences preferences = Preferences.userRoot().node("dlb/JavaVoice");
         JComboBox voices;
         Hashtable list;
         public JavaVoice() {
              super("Java Voice Synthesizer");
              addWindowListener(new AppCloser());
              DefaultComboBoxModel model = new DefaultComboBoxModel();
              try {
                   javax.speech.EngineList elist = Central.availableSynthesizers(null);
                   list = new Hashtable(elist.size());
                   Collections.sort(elist,this);
                   for (int i=0;i<elist.size();i++) {
                        SynthesizerModeDesc desc = (SynthesizerModeDesc)elist.elementAt(i);
                        model.addElement(desc.getModeName());
                        list.put(desc.getModeName(),desc);
                   synth = Central.createSynthesizer((SynthesizerModeDesc) list.get(preferences.get("voice.selected","")));
                   synth.allocate();
                   synth.resume();
              catch(EngineException ex) {
                   ex.printStackTrace();
              catch(AudioException ex) {
                   ex.printStackTrace();
              final JTextArea textArea = new JTextArea();
              textArea.setLineWrap(true);
              textArea.setWrapStyleWord(true);
              JScrollPane scrollPane = new JScrollPane(textArea);
              getContentPane().add(scrollPane,BorderLayout.CENTER);
              JToolBar toolBar = new JToolBar();
              JButton button = new JButton("Open");
              button.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent ev) {
                        JFileChooser fileChooser = new JFileChooser(preferences.get("voice.openDirectory",System.getProperty("user.dir")));
                        if(fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
                             readFile = fileChooser.getSelectedFile();
                             preferences.put("voice.openDirectory",readFile.getParent());
                             try {
                                  FileReader reader = new FileReader(readFile);
                                  textArea.read(reader,readFile.getName());
                                  reader.close();
                             catch(IOException ex) {
                                  ex.printStackTrace();
              toolBar.add(button);
              button = new JButton("Clear");
              button.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent ev) {
                        textArea.setText("");
              toolBar.add(button);
              toolBar.add(button);
              button = new JButton("Start");
              button.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent ev) {
                        String str = textArea.getSelectedText();
                        if(str != null && str.length() > 0) {
                             synth.speakPlainText(str.toLowerCase(),null);
                             textArea.setSelectionStart(0);
                             textArea.setSelectionEnd(0);
                        else {
                             str = textArea.getText();
                             synth.speakPlainText(str.toLowerCase(),null);
              toolBar.add(button);
              button = new JButton("Stop");
              button.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent ev) {
                        try {
                             synth.cancel();
                        catch(ArrayIndexOutOfBoundsException ex) {}
              toolBar.add(button);
              toolBar.addSeparator();
              toolBar.add(new JLabel("Voice:"));
              voices = new JComboBox(model);
              voices.setSelectedItem(preferences.get("voice.selected",""));
              voices.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent ev) {
                        try {
                             synth.deallocate();
                             String str = (String) voices.getSelectedItem();
                             preferences.put("voice.selected",str);
                             synth = Central.createSynthesizer((SynthesizerModeDesc) list.get(str));
                             synth.allocate();
                             synth.resume();
                        catch(EngineException ex) {
                             ex.printStackTrace();
                        catch(AudioException ex) {
                             ex.printStackTrace();
              toolBar.add(voices);
              toolBar.addSeparator();
              button = new JButton("Exit");
              button.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent ev) {
                        try {
                             synth.deallocate();
                        catch(EngineException ex) {
                             ex.printStackTrace();
                        preferences.putInt("voice.mainWindow.x",getLocation().x);
                        preferences.putInt("voice.mainWindow.y",getLocation().y);
                        preferences.putInt("voice.mainWindow.width",getSize().width);
                        preferences.putInt("voice.mainWindow.height",getSize().height);
                        System.exit(1);
              toolBar.add(button);
              getContentPane().add(toolBar,BorderLayout.NORTH);
              final JTextField textField = new JTextField();
              textField.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent ev) {
                        String txt = textField.getText();
                        if(txt.length() > 0) {
                             textArea.append(txt+'\n');
                             synth.speakPlainText(txt, null);
                             textField.setText("");
              getContentPane().add(textField,BorderLayout.SOUTH);
              int x = preferences.getInt("voice.mainWindow.x",1);
              int y = preferences.getInt("voice.mainWindow.y",1);
              int width = preferences.getInt("voice.mainWindow.width",640);
              int height = preferences.getInt("voice.mainWindow.height",480);
              setLocation(x,y);
              setSize(width,height);
              setVisible(true);
         public int compare(Object obj1, Object obj2) {
              SynthesizerModeDesc desc1 = (SynthesizerModeDesc) obj1;
              SynthesizerModeDesc desc2 = (SynthesizerModeDesc) obj2;
              return desc1.getModeName().compareToIgnoreCase(desc2.getModeName());
         public static void main(String args[]) {
              new JavaVoice();
         class AppCloser extends WindowAdapter {
              public void windowClosing(WindowEvent ev) {
                   try {
                        synth.deallocate();
                   catch(EngineException ex) {
                        ex.printStackTrace();
                   System.exit(1);
    ---------------------------------------------------------------------------------------------------------

    use code tags, post the error message.
    http://forum.java.sun.com/help.jspa?sec=formatting

  • Can anyone help me to find the Java Speech API?

    I really need to use the Java Speech API but I don't have any idea where to find it.
    In the Sun page are many implementations of the API but I want to use it and is very important for me.
    Please, can anyone send me the little API...........

    Look at the thread two posts down, that might be what youre looking for. Theres also a thread seven posts down that will help you.

  • Regarding Java Speech APIs

    Hey,
    Can i know where do i find java speech API kit for download...can any one help me...it's urgent?

    Google [java speech api kit]

  • Where can i download java speech api?

    Hi All,
    Where can i download java speech api?
    Thanks

    Thanks for the java speech download recommendations. I am going to give it a try on my site.
    [Tony From Sports Betting Picks|http://tonyspicks.com/contact-tony/about/]
    Edited by: tonyt42 on Apr 9, 2009 10:01 PM

  • Java speech api download

    Where I can download JAVA SPEECH API implementation?.
    I have been searching in web, there are many options.
    I'm spanish, please, sorry for my poor english.
    Edited by: Valhalla on Feb 25, 2009 9:03 AM

    follow the below links...
    http://freetts.sourceforge.net/docs/index.php
    http://freetts.sourceforge.net/docs/jsapi_setup.html

  • Java Speech + JSP

    Hi
    I'm new to the Java Speech API and JSP. Does anybody know if it is possible to use java speech in jsp pages? Somebody told me if you want to use java speech on the web you need to use applets. It that true?
    Oh yeah, I'm using the FreeTTS implementation from SourceForge.
    Thanks
    jjamesis

    Sorry if this takes up too much space.
    Heres the error when I try to run my applet.
    java.lang.NoClassDefFoundError: javax/speech/EngineModeDesc
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
         at java.lang.Class.getConstructor0(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Heres the code for the applet
    import java.io.File;
    import java.util.Locale;
    import java.util.Vector;
    import javax.speech.Central;
    import javax.speech.Engine;
    import javax.speech.EngineList;
    import javax.speech.synthesis.Synthesizer;
    import javax.speech.synthesis.SynthesizerModeDesc;
    import javax.speech.synthesis.SynthesizerProperties;
    import javax.speech.synthesis.Voice;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class SpeechApplet extends JApplet implements ActionListener {
    private JPanel mainPanel;
    private JLabel label;
    private JButton button;
    private JTextField textField;
    Synthesizer synthesizer;
    public void init() {
    label = new JLabel();
    textField = new JTextField(20);
    button = new JButton("Click Me");
    button.addActionListener(this);
    mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(label, BorderLayout.NORTH);
    mainPanel.add(textField, BorderLayout.CENTER);
    mainPanel.add(button, BorderLayout.SOUTH);
    Container c = getContentPane();
    c.add(mainPanel);
    setSize(100, 100);
    try {
    setup();
    } catch (Exception e) {}
    public void setup() throws Exception {
    String voiceName = "keven16";
    SynthesizerModeDesc desc = new SynthesizerModeDesc(
    null, // engine name
    "general", // mode name
    Locale.US, // locale
    null, // running
    null); // voice
    synthesizer = Central.createSynthesizer(desc);
    synthesizer.allocate();
    synthesizer.resume();
    desc = (SynthesizerModeDesc) synthesizer.getEngineModeDesc();
    Voice[] voices = desc.getVoices();
    Voice voice = null;
    for (int i = 0; i < voices.length; i++) {
    if (voices.getName().equals(voiceName)) {
    voice = voices[i];
    break;
    synthesizer.getSynthesizerProperties().setVoice(voice);
    public void speak(String input) throws Exception {
    synthesizer.speakPlainText(input,null);
    synthesizer.waitEngineState(Synthesizer.QUEUE_EMPTY);
    public void actionPerformed(ActionEvent ae) {
    try {
    String input = textField.getText();
    label.setText(input);
    } catch (Exception e) {}

  • Java Speech & Java Telephony

    hi all,
    i am new to java speech & java telephony, i need to know form where to get these two apis. after getting these two apis what are the necessary steps required to run a program. please any one help me out with one example step by step.
    thanks & regards
    dkumar_sharma

    Follow these links:
    http://java.sun.com/products/jtapi/
    http://java.sun.com/products/java-media/speech/
    http://java.sun.com/marketing/collateral/speech.html
    http://java.sun.com/products/java-media/speech/forDevelopers/jsapi-guide/index.html

  • Begginer : Java speech

    hi friends ...
    i want to make java application that can use the speech recognition technology ...... plz help how i start.....

    By typing "java speech open source" into Google, and reading the results.

  • I want to download  Java Speech API jar file  where can I get that ?

    hi All
    i started development on the Java Speech API. so were i can download the jar file and also if any one having the Maven artifact Id / group Id. please post it.it may helpful for me.
    Thanks
    Jega

    Sun has no such API like Java Speech API in their J2SE but there r other third parties api like FreeTTS which can be used
    to code speech apps.
    http://nchc.dl.sourceforge.net/project/freetts/FreeTTS/FreeTTS%201.2.2/freetts-1.2.2-bin.zip

  • Java speech recognition software ?

    Hi Software Experts.
    I have 2 short questions.
    1. does any one here have any knowledge of any java speech recognition software ?
    2. is it true that all speech recognition software has to be trained ?
    Are there some simple ones on the market that will test for 1 word and therefore not need to be trained ? Or trained a lot less ?

    IBM makes Via voice, a commercial package. Almost all apps need some training, to be truely effective, as the user's speech patterns vary. I am not aware of any Sun classes for this, there may be some 3rd party classes out there.... - Bart

  • Cannot Hear something...[JAVA SPEECH]

    Why i don't hear nothing?
    Someone help me!!
    This is source code:
    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();

    Hi,
    Are you running the Speech over Via Voice runtimes? If you are running it using Via Voice then make sure that your classpaths are set appropriatly pointing to the ibmjs directory where the runtimes are contained. This is usually the problem.

  • Java Speech stops speaking

    I have been able to start the synthesizer and start speaking, however, there have been times when the application just quits speaking. It's still going through the code, you just can no longer here anything. Any ideas on what may be causing this, or what I can do to detect it and start it up again?
    Thanks.

    can any body help me here
    i have windows2000 and installed
    Freetts and set jsapi.jar in the
    classpath for compiling HelloWorld
    speech program and it compiled well,
    also i put speech.properties file
    without modifying it in my c:\j2sdk1.4\jre\speech.properties
    now iam getting error as
    Can't find synthesizer.
    Make sure that there is a "speech.properties" file at either of these locations:
    user.home: C:\Documents and Settings\Administrator
    java.home: c:\j2sdk1.4\jre
    what could be the problem here. please help me..
    thanx.

  • Speech Recogniser

    Hello,
    I'm a student of final Year BSc. & thinking to do a project of Speech dictator Systm using Java. Can you help me about that system. I mean about the scope of the system. & an important thing is that I am also not more fimiliar with java.
    Thanks in advance.

    Is there any book through which I can be able to do Speech to Text by using JSAPI.

  • Java Speech with Netbeans

    Having difficulty trying to use netbeans together with FreeTT. Eventhough i have installed FreeTTS i always get error message when i import javax.speech

    >
    Having difficulty trying to use netbeans together with FreeTT. Eventhough i have installed FreeTTS i always get error message when i import javax.speech>To compile successfully will require that all (the mentioned) Java classes are on the compilation class path.
    To run code successfully requires not only the Java classes, but also any natives, to be on the application's run time class path.
    How you add the resources to 'netbeans' I neither know nor care (I do not use, nor provide support for, netbeans). OTOH, Netbeans can understand and work with Ant build files, so if you are willing to abandon Netbeans automagic ways of doing things that seem not to work, for compiling and running using an Ant build file, you might find more help around these forums (and specifically from me).

Maybe you are looking for

  • [Solved] Can't get sound to work proper

    Hey I use KDE4 with KMix. I have 5.1 Optical sound. When I enter Audio Setup in KMix and test the "hw: 0,1" option I get playback. But I haven't gottten any sound except that. Tried a video in MPlayer and Youtube video in Firefox. I'm still abit new

  • JPG image shows up fine in layout but a section gets cut off a little at the bottom in exported PDF

    I've got a JPG inserted at the top of the page and there are text boxes below it.  In the layout everything looks fine, nothing is overlapping or getting cut off.  But when I export the image (best quality) as a PDF, a few of the letters in the JPG l

  • Mozilla.cfg giving error

    <blockquote>Locking duplicate thread.<br> Please continue here: [[/questions/886352]]</blockquote> I now have this as my config but get an error Mozilla Global Preferences <pre><nowiki>/* This file is to set and lock default preferences. * Locate the

  • Test Equipment for calibration

    Dear Experts, Is it necessary to create Calibration Orders against Test Equipments only ?? or we can do the same against Machines also?? As in some cases there is preventive & calibration plan against same equipment then if we create Test equipment,,

  • T430 Thermal Limit and Fan speed

    Hello, I have a T430 with the i7-3520 and NVS 5400 1GB. I'm a little concerned with the high temperatures my system shows. At idle and most of the time the temperature on the cpu is reported in the low/mid 40C range. (fan is very quiet or nearly sile