Search code examples
speech-recognitioncmusphinxsphinx4

Configuration manager of Sphinx4 returns null from lookup


i encountered a problem while following this tutorial to create a speech recognition using Sphinx4 with the Java-Speech-API. I did the exactly same as the author did in his blog, but when i execute my program i receive a NullPointerException at

Recognizer recognizer = (Recognizer)cm.lookup("recognizer");
recognizer.allocate(); //Here is my null-pointer

Is it possible it's a security issue? If it is one, how can i fix it?

Thanks for your help, have a nice day.


Solution

  • but when i execute my program i receive a NullPointerException at

    recognizer is null because it's missing in your config file. The configuration manager fails to find recognizer component and returns null.

    You need to make sure you have a proper config file

    Is it possible it's a security issue?

    No

    i encountered a problem while following this tutorial to create

    Instead of following some broken tutorial from the web you should better read official one:

    http://cmusphinx.sourceforge.net/wiki/tutorial

    to understand the basics. Also, you can use any demo from Sphinx4 which fits you needs instead of writing your own code as recommended by the blog author. This way you could reach your goals faster.