I have a problem. You see, I'm creating this program, and I want voice recognition. CMUSphinx 4 seemed like the best option, so I just downloaded the jars and added them to my project as a compacted library. So I got this code from the CMUSphinx Wiki and I tried it out. Here's the code:
Configuration configuration = new Configuration();
// Set path to acoustic model.
configuration.setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us");
// Set path to dictionary.
configuration.setDictionaryPath("resource:/edu/cmu/sphinx/models/en-us/cmudict-en-us.dict");
// Set language model.
configuration.setLanguageModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us.lm.dmp");
Unfortunately, it seems as though I got getting this error:
Caused by: Property exception component:'acousticModelLoader' property:'location' - Can't locate resource:/edu/cmu/sphinx/models/en-us/en-us edu.cmu.sphinx.util.props.InternalConfigurationException: Can't locate resource:/edu/cmu/sphinx/models/en-us/en-us
So, I tried troubleshooting and added an extra "/" to
configuration.setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us/");
That seemed to solve that part of it but then, I got ANOTHER error after adding the extra "/":
Caused by: Property exception component:'dictionary' property:'fillerPath' - Can't locate resource:/edu/cmu/sphinx/models/en-us/en-us//noisedict edu.cmu.sphinx.util.props.InternalConfigurationException: Can't locate resource:/edu/cmu/sphinx/models/en-us/en-us//noisedict
Notice the extra "/" there. Basically, does anybody have a way to get around the fact that I'm getting an error with or without that extra "/"? It seems to me like there's an error in the code of sphinx4 itself. I've been trying to trace where the extra "/" is being added by decompiling each class involved in the error with no luck. Help?
I've just committed an update that should make it better, see also
Sphinx4 breaks on AWS Elastic Beanstalk, works on dev machine