0

I am trying to import javax.speech.recognition.Result; in my code. But i am getting class not found error.

On checking with javap; as follows:-

C:\Documents and Settings\ankit.g>javap javax.speech.recognition.Result
Error:  class not found: javax.speech.recognition.Result

I am using java 7, please find the following output:-

C:\Documents and Settings\ankit.g>java -version
  java version "1.7.0_05"
  Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
  Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode, sharing)

Please help, I am trying to work on speech recognition.

Thanks


after installing jsapi.sh file the screenshot of the dir is as follows:- enter image description here

are all the jar files needs to be included; any easy tutorial or steps would help me a lot.

Ankit
  • 609
  • 2
  • 10
  • 26
  • 1
    You need to include a speech recognition library. AFAIK Its not built in. Try searching for a library which implements the standard API which suits your needs. – Peter Lawrey Aug 28 '12 at 13:15

3 Answers3

2

You class

javax.speech.recognition.Result.class

is not available on the classpath. You might have misplaced you speech recognition jar (java library containing speech recognition specific classes) containing this class. Check out on that.

sakthisundar
  • 3,278
  • 3
  • 16
  • 29
0

Try the 'FreeTTS' implementation and get the JSAPI implementation from within the package. I don't remember that JSAPI was provided with the regular JDK, but I could be wrong.

http://freetts.sourceforge.net/docs/index.php

The src zip file contains the JSAPI.sh and JSAPI.exe script with a readme on how to make it available.

  • i HAVE installed freetts, but still I am not able to import the classes. Please help – Ankit Aug 28 '12 at 17:34
  • When you get the FreeTTS SRC.zip, there's a LIB folder in it. In there, you will find a JSAPI.exe file or a JSAPI.sh script that you need to run. It will unpack the file 'jsapi.jar'. You then only need to use this jar file and reference it from your ant, eclipse, maven or whatever else you might be using. –  Aug 28 '12 at 19:24
  • thanks, i ran the file and some files might have populated in the directory. I am not sure how do i import the files to eclipse. Any help, please? – Ankit Aug 29 '12 at 03:49
0

Here is a Hello World type speech recognition sample program with commentary.

Here is the wikipedia article on the Java Speech API with a link to an open source speech synthesis package FreeTTS.

Here is a stackoverflow question on Java speech recognition packages for Android. There are other stackoverflow questions and answers available as well.

Community
  • 1
  • 1
Richard Chambers
  • 16,643
  • 4
  • 81
  • 106