Hey all. I'm trying to compile hello world and run it from a different directory so that I can start building my application. I'm having trouble getting it to work though. I copied HellWorld.java to myProject/java/source and I copied hello.gram and helloworld.config.xml to myProject/java/classes/demo/sphinx/helloworld. I have not yet edited HelloWorld.java at all. I can't seem to figure out what the problem is and I would greatly appreciate some help (I'm sure it's something stupid).
My ant build file is copied at the end of this post. I'm not using an IDE (just jedit), and when compiling and running the original demo from the install directory it works fine. When I run ant it compiles and jar's everything just fine. I checked the project.jar archive with 7zip and it says it appears to have everything it needs. Nevertheless when I run the program (using java -mx200m -jar bin/project.jar) I get a bunch of errors. I've included below 1)the file tree, 2) the ant build file, 3) the output of the "ant" command, and 4)the output of running the executable.
I would greatly appreciate some help in diagnosing the problem so that I can get to work on my project. I'm excited that an open source speech recognizer exists though I'm a little confused by how to use it. It seems simple enough but...
CreateExecutableJar: [jar] Building jar: C:...\java\bin\Sui.jar [echo] Jar created
BUILD SUCCESSFUL
Total time: 2 seconds
4) output of program (errors)
C:...\java>java -mx200m -jar bin/Sui.jar
Loading...
Exception in thread "main" java.lang.NullPointerException
at edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader.loadProp
erties(ModelLoader.java:372)
at edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader.getIsBin
aryDefault(ModelLoader.java:386)
at edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader.newPrope
rties(ModelLoader.java:346)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.ja
va:403)
at edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model.newProperties(
Model.java:159)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.ja
va:403)
at edu.cmu.sphinx.linguist.flat.FlatLinguist.setupAcousticModel(FlatLinguist.java:299)
at edu.cmu.sphinx.linguist.flat.FlatLinguist.newProperties(FlatLinguist.java:246)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.ja
va:403)
at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.newProperties(SimpleBreadth
FirstSearchManager.java:180)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.ja
va:403)
at edu.cmu.sphinx.decoder.Decoder.newProperties(Decoder.java:71)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.ja
va:403)
at edu.cmu.sphinx.recognizer.Recognizer.newProperties(Recognizer.java:93)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at demo.sphinx.helloworld.HelloWorld.main(HelloWorld.java:49)
C:...\java>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
And.... There it is. Thanks so much Nickolay. WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar was actually the one I needed. It was in the library path along with the other .jar's. I only added the jar's I noticed in the original demos.xml ant build file. I must have missed that one or else it's requirement is hidden in the configuration file. I'm still not 100% on how the configuration manager works or why it is necessary (but I trust those CMU guys know what they're doing). Once I added the line <zipfileset src="${sphinx_dir}/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar" /> the program runs correctly.
Thanks again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey all. I'm trying to compile hello world and run it from a different directory so that I can start building my application. I'm having trouble getting it to work though. I copied HellWorld.java to myProject/java/source and I copied hello.gram and helloworld.config.xml to myProject/java/classes/demo/sphinx/helloworld. I have not yet edited HelloWorld.java at all. I can't seem to figure out what the problem is and I would greatly appreciate some help (I'm sure it's something stupid).
My ant build file is copied at the end of this post. I'm not using an IDE (just jedit), and when compiling and running the original demo from the install directory it works fine. When I run ant it compiles and jar's everything just fine. I checked the project.jar archive with 7zip and it says it appears to have everything it needs. Nevertheless when I run the program (using java -mx200m -jar bin/project.jar) I get a bunch of errors. I've included below 1)the file tree, 2) the ant build file, 3) the output of the "ant" command, and 4)the output of running the executable.
I would greatly appreciate some help in diagnosing the problem so that I can get to work on my project. I'm excited that an open source speech recognizer exists though I'm a little confused by how to use it. It seems simple enough but...
1) file tree
..\java
│ build.xml
│
├───bin
│ sui.jar
│
├───classes
│ └───demo
│ └───sphinx
│ └───helloworld
│ hello.gram
│ HelloWorld.class
│ helloworld.config.xml
│
└───source
hello.gram
helloworld.config.xml
HelloWorld.java
helloworld.Manifest
2) Ant build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="CreateExecutableJar" name="SUI">
<property name="src_dir" value="./source"/>
<property name="class_dir" value="./classes"/>
<property name="bin_dir" value="./bin"/>
<property name="sphinx_dir" value="C:/sphinx/lib"/>
</project>
3) Output of ant
C:...\java>ant
Buildfile: build.xml
CompileClasses:
[javac] Compiling 1 source file to C:...\java\classes
[javac] C:...\java\source\HelloWorld.java
[echo] Classes Compiled
CreateExecutableJar:
[jar] Building jar: C:...\java\bin\Sui.jar
[echo] Jar created
BUILD SUCCESSFUL
Total time: 2 seconds
4) output of program (errors)
C:...\java>java -mx200m -jar bin/Sui.jar
Loading...
Exception in thread "main" java.lang.NullPointerException
at edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader.loadProp
erties(ModelLoader.java:372)
at edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader.getIsBin
aryDefault(ModelLoader.java:386)
at edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader.newPrope
rties(ModelLoader.java:346)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.ja
va:403)
at edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model.newProperties(
Model.java:159)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.ja
va:403)
at edu.cmu.sphinx.linguist.flat.FlatLinguist.setupAcousticModel(FlatLinguist.java:299)
at edu.cmu.sphinx.linguist.flat.FlatLinguist.newProperties(FlatLinguist.java:246)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.ja
va:403)
at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.newProperties(SimpleBreadth
FirstSearchManager.java:180)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.ja
va:403)
at edu.cmu.sphinx.decoder.Decoder.newProperties(Decoder.java:71)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.ja
va:403)
at edu.cmu.sphinx.recognizer.Recognizer.newProperties(Recognizer.java:93)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)
at demo.sphinx.helloworld.HelloWorld.main(HelloWorld.java:49)
C:...\java>
P.S. Sorry for the poor formatting. For some reason I figured the forum would preserve spaces. I can post files if it is necessary.
I don't see you add the model jar WSJ_8gau_13dCep_8kHz_31mel_200Hz_3500Hz.jar into classpath nor it's packed into jar. Where is it?
And.... There it is. Thanks so much Nickolay. WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar was actually the one I needed. It was in the library path along with the other .jar's. I only added the jar's I noticed in the original demos.xml ant build file. I must have missed that one or else it's requirement is hidden in the configuration file. I'm still not 100% on how the configuration manager works or why it is necessary (but I trust those CMU guys know what they're doing). Once I added the line <zipfileset src="${sphinx_dir}/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar" /> the program runs correctly.
Thanks again.