Can someone point me in the right direction for accessing pocketsphinx via java. I've looked at the tests on github and know that swig must be used. The only examples I can find are for android. I'm not sure how to actually build the java packages I need via swig.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can type make in pocketsphinx/swig/java, it will build the demo. make run will run it. You need to have functional pkg-config and properly set JAVA_HOME.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the help. I got to the point where all the .java files are created. That leaves me with one more question. Bear with me, not a programmer by trade.
Do I simply import those .java files into my project and as long as the app is deployed on a machine with pocketsphinx installed it will work?
Can someone point me in the right direction for accessing pocketsphinx via java. I've looked at the tests on github and know that swig must be used. The only examples I can find are for android. I'm not sure how to actually build the java packages I need via swig.
It depends on the OS
Linux. Sorry should have specified that.
You can type make in
pocketsphinx/swig/java
, it will build the demo.make run
will run it. You need to have functional pkg-config and properly set JAVA_HOME.Wow that's all? So that will then build the .java packages? Sorry first time I've even heard of swig.
import edu.cmu.pocketsphinx.Decoder;
import edu.cmu.pocketsphinx.Config;
import edu.cmu.pocketsphinx.Segment;
import edu.cmu.pocketsphinx.Hypothesis;
import edu.cmu.pocketsphinx.SegmentIterator;
Yes
It will build java files, you have to package them yourself if you want to.
It is better to read swig docs
Thanks for the help. I got to the point where all the .java files are created. That leaves me with one more question. Bear with me, not a programmer by trade.
Do I simply import those .java files into my project and as long as the app is deployed on a machine with pocketsphinx installed it will work?
I'm making that assumption based on https://github.com/cmusphinx/pocketsphinx/blob/master/swig/java/test/DecoderTest.java
I read through the swig docs and either missed or didn't see this part.
EDIT: Answered my own question. So I missed the created .so file. Also the loading of that library. Makes more sense now. Thanks
Last edit: TheEditor 2016-07-26