5

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?

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
Max K
  • 65
  • 7
  • You already asked the same question here http://stackoverflow.com/questions/30689690/cmusphinx-location-error and didn't reply on comments. There is no much need to post another one on the same topic. – Nikolay Shmyrev Jun 07 '15 at 21:58
  • @NikolayShmyrev yeah but that one was MUCH more vague since it was off my phone so I created this one. You can't deny that this one is much easier to follow. Plus I'm relying on this for school so I need to get this done ASAP. If that is a problem for you I can't delete the other one due to a bug in StackExchange. Sorry! – Max K Jun 07 '15 at 22:10
  • @NikolayShmyrev I changed it to display the link to this so if you gave it a -1 for double posting could you change that now that whatever troubled you is fixed – Max K Jun 07 '15 at 22:17
  • It's better to delete the original question then. And you still did not reply on the original question comment. – Nikolay Shmyrev Jun 07 '15 at 22:17
  • @NikolayShmyrev I did and if you look at the first error above that is what I got for just running it clean without the slash. It's wierd. Oh and if it helps I'm running IcedTea on Ubuntu for java. – Max K Jun 07 '15 at 22:24
  • @NikolayShmyrev I finally deleted it sorry any feedback about it now or no – Max K Jun 07 '15 at 22:40
  • Try again without slash. Provide information about sphinx4 version you are using. Provide full exception stacktrace. – Nikolay Shmyrev Jun 08 '15 at 00:32
  • @NikolayShmyrev I was thinking of doing that it's just that people are less likely to help if the description and everything is lonf – Max K Jun 08 '15 at 00:46
  • @NikolayShmyrev I'll do that though and its probably Ubuntus file system because I fixed the source code for the //noisedict part and now there's another one so I might try the jar on windows which is also on the same computer and then it might work. – Max K Jun 08 '15 at 00:47
  • You seem to have trouble to understand what I ask you about – Nikolay Shmyrev Jun 08 '15 at 06:49
  • I am seeing the same: I tried using maven and tried forking the repos and cooking the jars myself. Both approaches fail for similar (but different) reasons. Any clue? – Dan Jun 12 '15 at 14:43
  • @Dan what OS do you use? – Max K Jun 14 '15 at 19:27
  • do we have the solution please? – Durgesh Kumar Oct 07 '17 at 10:04

1 Answers1

0

I've just committed an update that should make it better, see also

Sphinx4 breaks on AWS Elastic Beanstalk, works on dev machine

Community
  • 1
  • 1
Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87