Menu

error in sphinx4

annnca
2014-04-17
2014-05-08
  • annnca

    annnca - 2014-04-17

    I create the Configuration like in the model from the site,in java :
    Configuration configuration = new Configuration();
    // Set path to acoustic model.
    configuration.setAcousticModelPath("D:\NetBeansProjects\ChatGdetection\result_cD_128gmm_100_128");
    // Set path to dictionary.
    configuration.setDictionaryPath("models/rodigits.dic");
    // Set language model.
    configuration.setLanguageModelPath("models/rodigits.fsg");
    and when i want to call the method
    StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(configuration) i have this error:
    "Thread-0" java.lang.NoSuchMethodError: edu.cmu.sphinx.util.props.ConfigurationManagerUtils.resourceToURL(Ljava/lang/String;)Ljava/net/URL;

    What i had done wrong?Thanks!

     
  • Nickolay V. Shmyrev

    What i had done wrong?Thanks!

    When you reported about issues you forgot to mention the version of sphinx4 you are working with

    When you pasted exception text you forgot to paste full stack trace of the exception and pasted just one line.

     
  • annnca

    annnca - 2014-04-17

    I use sphinx4-5prealpha,and the full exception is:
    Exception in thread "Thread-0" java.lang.NoSuchMethodError: edu.cmu.sphinx.util.props.ConfigurationManagerUtils.resourceToURL(Ljava/lang/String;)Ljava/net/URL;
    at edu.cmu.sphinx.api.Context.<init>(Context.java:64)
    at edu.cmu.sphinx.api.Context.<init>(Context.java:49)
    at edu.cmu.sphinx.api.AbstractSpeechRecognizer.<init>(AbstractSpeechRecognizer.java:37)
    at edu.cmu.sphinx.api.StreamSpeechRecognizer.<init>(StreamSpeechRecognizer.java:33)
    at server.ClientPeer.run(ClientPeer.java:98)</init></init></init></init>

     
  • Nickolay V. Shmyrev

    What is your JVM? How do you set class path?

     
  • annnca

    annnca - 2014-04-17

    JVM 24.0-b56 .I dont set class path because i didnt know that it must be done.How can I do this?

     
  • Nickolay V. Shmyrev

    JVM 24.0-b56

    This is not the full version. What is the full version of your JVM

    I dont set class path because i didnt know that it must be done.How can I do this?

    How do you run your code

     
  • annnca

    annnca - 2014-04-23

    I don`t run my code,i only copy src-directory as source folders to my project and i added lib/js.jar, lib/tags.jar and lib/jsapi.jar to my project.I have windows,how i can run my code to work?

     
  • Nickolay V. Shmyrev

    I don`t run my code

    You are trying to run program in IDE or some other way. How? Are you using Netbeans? What are you doing? Can you share the project you have? What sphinx4 version are you trying? Is it the latest 5prealpha version? Remember, the more information you provide the faster you get an answer.

    i only copy src-directory as source folders to my project and i added lib/js.jar, lib/tags.jar and lib/jsapi.jar to my project

    This is a bad idea to copy src folder. You need to add sphinx4.jar and other jars into your project instead.

     
  • annnca

    annnca - 2014-04-23

    yes,my version is 5prealpha and i use netbeans.i tried to run StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(configuration) in IDE and agot that error.I had already copy the sphinx4.jar in my library project.

     
  • Nickolay V. Shmyrev

    Ok, pack your project in archive and share it.

     
  • annnca

    annnca - 2014-04-23

    that is!i used sphinx4 in ClientPeer class.

     
  • annnca

    annnca - 2014-04-23

    i cant archive the whole project because its too large.

     
  • Nickolay V. Shmyrev

    Too large for what? You can upload it to dropbox for example, it should fit.

     
  • annnca

    annnca - 2014-04-24

    i can t upload all the project.i put only the main classes where is use sphinx4.can you help me to run the ClientPeer class without errors?

     
  • Nickolay V. Shmyrev

    Sorry, without the whole project it's hard to help you. I do not have telepath capabilities to read contents on your desktop. Most likely you didn't add jar into the project properly, you need to do it in project properties, you probably just placed jar in the project without plugging it in. This information is contained in the project files, without project files I can't help you.

     
  • annnca

    annnca - 2014-04-24

    how to plug the jar in my project?

     
  • Nickolay V. Shmyrev

    Steps of adding external jar or folder in NetBeans project which I have followed:

    1. Go to project properties by right clicking on project.

    2. Then click on Libraries tab, You will see Compile, Run, Compile Tests, Run Tests tabs.

    3. Click on Compile tab

    4. Click on Add JAR/Folder button at right

    5. Then browse and select the jar files or folder which you want to include. Included jar files or libraries will show on the following box of Compile tab.

    6. Click on OK button.

    7. Finished.

     
  • annnca

    annnca - 2014-05-07

    I resolved the problem with integration but now when I try to call
    LiveSpeechRecognizer recognizer = new LiveSpeechRecognizer(configuration);
    recognizer.startRecognition(true);
    i received the error that is in the picture

     
    • Horia Cucu

      Horia Cucu - 2014-05-08

      You need to use exception.printStackTrace() and show the whole error trace
      in order to get an answer. The picture is not really helpful.
      Horia

       

      Last edit: Nickolay V. Shmyrev 2014-05-08

Log in to post a comment.

MongoDB Logo MongoDB