4 Replies Latest reply: Jul 31, 2008 1:32 PM by 843802 RSS

    Speech to Text

    843802
      Hi Frds,
      Can any one help me how to write a program for speech to text. I am having freetts and Talking java(from cloudgroun) packages. Can any one help me what to do.
      Plz, Send me mail at chandru155@yahoo.com
        • 1. Re: Speech to Text
          843802
          Hi
          Did you find a solution for converting speech to text?i am also tyring to do this and want my application to print what i say in text fields but so far i cannot figure it out!!!!help!!!
          • 2. Re: Speech to Text
            843802
            I don't know how much help this will be but i have something that can start you off from long ago
            import java.awt.event.*;
            import java.io.*;
            import javax.swing.*;
            import java.awt.*;
            import javax.media.*;
            import java.applet.*;
            import sun.audio.AudioPlayer;
            import sun.audio.AudioStream;
            import java.text.MessageFormat;
            import java.util.*;
            
            
            public class MainClass extends JFrame  implements ActionListener {
              JTextField jtf = new JTextField(15);
             // jtf.setText(".");
              public MainClass() {
            JPanel jp = new JPanel();
            jp.add(jtf, BorderLayout.NORTH);
            getContentPane().add(jp);
                  //jp.add(jtf);
                  jtf.addActionListener(this);
            
            }
            
            public void actionPerformed(ActionEvent ae) {
            
            if (jtf.getText().equals("open"))
            
            
            
                   {
                          try
                                          {
                    AudioStream song = new AudioStream(new FileInputStream(new File("open.wav")));
                    System.out.println("Open");
                    AudioPlayer.player.start(song);
            
                                     }
                                              catch(Exception ex)
                                             {
                                              ex.printStackTrace();
                                             }
            
                        }
            
            
            }
            
              public static void main(String[] args) {
               MainClass frame = new MainClass();
                //jp.getContentPane().add(new MainClass());
            
               frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setSize(200, 200);
                frame.setVisible(true);
            
               
              }
            
            }
            save a file called open.wav so wen u type open in textfield it should output open audio, unfortunately this will only work a word at a time. hope i helped
            • 3. Re: Speech to Text
              843802
              umm ahmed_mo, your code is for

              text --> speech

              he asks for

              speech --> text

              ;)

              btw a good speech to text implementation is Sphinx4
              [Sphinx4 Homepage|http://cmusphinx.sourceforge.net/sphinx4/]

              they have some code examples, which you can use

              Edited by: NeoSniperkiller on 23-mei-2008 10:57
              • 4. Re: Speech to Text
                843802
                I used that Sphinx. But i cant write a effiecient program. It works for some times, but mostly it doest recognize my voice.
                Can you help with any other one?