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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Steps of adding external jar or folder in NetBeans project which I have followed:
Go to project properties by right clicking on project.
Then click on Libraries tab, You will see Compile, Run, Compile Tests, Run Tests tabs.
Click on Compile tab
Click on Add JAR/Folder button at right
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.
Click on OK button.
Finished.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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!
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.
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>
What is your JVM? How do you set class path?
JVM 24.0-b56 .I don
t set class path because i didnt know that it must be done.How can I do this?This is not the full version. What is the full version of your JVM
How do you run your code
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?
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.
This is a bad idea to copy src folder. You need to add sphinx4.jar and other jars into your project instead.
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.
Ok, pack your project in archive and share it.
that is!i used sphinx4 in ClientPeer class.
i can
t archive the whole project because its too large.Too large for what? You can upload it to dropbox for example, it should fit.
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?
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.
how to plug the jar in my project?
Steps of adding external jar or folder in NetBeans project which I have followed:
Go to project properties by right clicking on project.
Then click on Libraries tab, You will see Compile, Run, Compile Tests, Run Tests tabs.
Click on Compile tab
Click on Add JAR/Folder button at right
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.
Click on OK button.
Finished.
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
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