I've been wrestling with running the sphinx4 demos in Netbeans and did a search in these forums. I came across a promising thread containing this link:
which I found referenced in another forum thread, but in each case I got a 404 Error. Just wanted to let the admin know. They probably do, but just in case.
Cheers,
nathanael
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I see. Two pages covering two different IDEs were condensed down to a few lines...that's pretty amazing! However, and forgive my boldness, but it may be just a little too...terse? I'm not sure it reflects the current sphinx4 download or IDE versions, and it's confusing in light of forum posts like this -- https://sourceforge.net/forum/message.php?msg_id=6647868.
Perhaps extra information should be added elsewhere too, I don't know. For example, in the pages describing how to run each demo, only command line information is given. What if all I want to do is run a demo from its source, unmodified, in NetBeans? Is this just so trivial, and am I therefore really that stupid, that it's not worth mentioning? (rhetorical -- please feel free to NOT answer that Nickolay). Or do I have a valid point? I guess that's for the project heads to decide, but to me, it seems that there is a massive leap from running the demo jars on the command line to actually DEVELOPING with the source, and the documentation on setting up the IDE and/or running the demos does not bridge the gap.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The pages were removed just because they become obsolete due to code reorganization. The developer was lazy enough to suggest something different. If you could create more detailed text/screencast about setting up the IDE that would be very appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I seem to have accomplished what I wanted, which was to run the Transcriber demo from source in NetBeans, and I wanted to post what I did -- either this will be helpful in updating help, or someone will (hopefully) point out some sort of glaring omission that's going to burn me, or both.
Win XP SP3
JDK 1.6.0_14
NetBeans 6.7
sphinx4-1.0beta2 built with ant 1.7.1
In NetBeans...
1) New Project-->Java Application, no Main class specified
2) copied the files from sphinx4-1.0beta2\src\apps...\transcriber\ into the (empty) default package, and deleted the manifest
3)added jsapi.jar, sphinx4.jar, and TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar to my Libraries folder
4)compiled Transcriber.java
5)ran it...hey presto!
>If you could create more detailed text/screencast about setting up the IDE that would be very appreciated.
I'm really not sure you want that. I don't know what I'm doing, just sort of figuring out as I go, with help from forum snippets here and there. This stuff I'm presenting is just as much for correction as it is to provide useful information! On that note, one rather important thing I forgot to mention is editing the config.xml file a little.
In grammar config for the Transcriber demo for instance, I had to change the value of grammar location to my project's class directory, like so:
<property name="grammarLocation"
value="file:\C:\Documents and Settings\NJL\My Documents\NetBeansProjects\SphinxTest\src"/>
Then, when I ran the project, I was prompted to name a main class, which I did, and it worked.
So to sum up:
New Project-->Java Application (uncheck set main class)
Copy files from demo of interest into the default package
Look in the manifest to see which jars you need to add to the classpath
Right click libraries-->Add JAR/Folder, navigate to sphinx4's \lib and add those jars Delete the manifest
Edit the config.xml to reflect the grammar location for this copy of the demo
Compile the java file
Run the project-->specify main class in the prompt
This worked, in duplicate, with the HelloWorld, Transcriber, and WavFile demos. It may not be correct which is my concern, but it worked.
I'm having problems applying this method to the Lattice demo however. Java is throwing a fileNotFoundException for sphinx4-1.0beta2\models\language\wsj\wsj5kc.Z.DMP when recognizer.allocate() is called. This file isn't (visibly) referenced anywhere in the code or config files. It's weird because the binary works just fine from the command line. I'll spend a little more time on this after lunch. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there,
I've been wrestling with running the sphinx4 demos in Netbeans and did a search in these forums. I came across a promising thread containing this link:
http://cmusphinx.sourceforge.net/sphinx4/doc/Netbeans.html
I tried it yesterday and today, as well as
http://cmusphinx.sourceforge.net/sphinx4/doc/Eclipse.html
which I found referenced in another forum thread, but in each case I got a 404 Error. Just wanted to let the admin know. They probably do, but just in case.
Cheers,
nathanael
They were moved permanently, new place is
http://cmusphinx.sourceforge.net/sphinx4/#setupide
I see. Two pages covering two different IDEs were condensed down to a few lines...that's pretty amazing! However, and forgive my boldness, but it may be just a little too...terse? I'm not sure it reflects the current sphinx4 download or IDE versions, and it's confusing in light of forum posts like this -- https://sourceforge.net/forum/message.php?msg_id=6647868.
Perhaps extra information should be added elsewhere too, I don't know. For example, in the pages describing how to run each demo, only command line information is given. What if all I want to do is run a demo from its source, unmodified, in NetBeans? Is this just so trivial, and am I therefore really that stupid, that it's not worth mentioning? (rhetorical -- please feel free to NOT answer that Nickolay). Or do I have a valid point? I guess that's for the project heads to decide, but to me, it seems that there is a massive leap from running the demo jars on the command line to actually DEVELOPING with the source, and the documentation on setting up the IDE and/or running the demos does not bridge the gap.
The pages were removed just because they become obsolete due to code reorganization. The developer was lazy enough to suggest something different. If you could create more detailed text/screencast about setting up the IDE that would be very appreciated.
Hello again,
I seem to have accomplished what I wanted, which was to run the Transcriber demo from source in NetBeans, and I wanted to post what I did -- either this will be helpful in updating help, or someone will (hopefully) point out some sort of glaring omission that's going to burn me, or both.
Win XP SP3
JDK 1.6.0_14
NetBeans 6.7
sphinx4-1.0beta2 built with ant 1.7.1
In NetBeans...
1) New Project-->Java Application, no Main class specified
2) copied the files from sphinx4-1.0beta2\src\apps...\transcriber\ into the (empty) default package, and deleted the manifest
3)added jsapi.jar, sphinx4.jar, and TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar to my Libraries folder
4)compiled Transcriber.java
5)ran it...hey presto!
However, the output was not expected based on http://cmusphinx.sourceforge.net/sphinx4/src/apps/edu/cmu/sphinx/demo/transcriber/README.html. My output was:
zero zero zero
two one oh
zero one eight zero three
I do not believe this was due to anything related to NetBeans, as the same output was obtained from the command line:
sphinx4>java -jar bin/Transcriber.jar
Hope this helps/did I do anything wrong?
Thanks,
Nathanael
>If you could create more detailed text/screencast about setting up the IDE that would be very appreciated.
I'm really not sure you want that. I don't know what I'm doing, just sort of figuring out as I go, with help from forum snippets here and there. This stuff I'm presenting is just as much for correction as it is to provide useful information! On that note, one rather important thing I forgot to mention is editing the config.xml file a little.
In grammar config for the Transcriber demo for instance, I had to change the value of grammar location to my project's class directory, like so:
<property name="grammarLocation"
value="file:\C:\Documents and Settings\NJL\My Documents\NetBeansProjects\SphinxTest\src"/>
Then, when I ran the project, I was prompted to name a main class, which I did, and it worked.
So to sum up:
New Project-->Java Application (uncheck set main class)
Copy files from demo of interest into the default package
Look in the manifest to see which jars you need to add to the classpath
Right click libraries-->Add JAR/Folder, navigate to sphinx4's \lib and add those jars
Delete the manifest
Edit the config.xml to reflect the grammar location for this copy of the demo
Compile the java file
Run the project-->specify main class in the prompt
This worked, in duplicate, with the HelloWorld, Transcriber, and WavFile demos. It may not be correct which is my concern, but it worked.
I'm having problems applying this method to the Lattice demo however. Java is throwing a fileNotFoundException for sphinx4-1.0beta2\models\language\wsj\wsj5kc.Z.DMP when recognizer.allocate() is called. This file isn't (visibly) referenced anywhere in the code or config files. It's weird because the binary works just fine from the command line. I'll spend a little more time on this after lunch. :)