I am using sphinx4 1.0 beta 6
to make a voice recognizer in Java. In sphinx4 there is demo sample called HelloWorld. That demo runs well without any problem. But it recognize only few words. I have to change its hello.gram
file. If I add some extra words in that grammar file it doesn't work for those word. How can I add my own grammar file and load in HelloWorld sample? I have studied a lot on JSGFGrammar. But I couldn't understand. I am using Netbeans IDE.
Asked
Active
Viewed 1,282 times
0

Cœur
- 37,241
- 25
- 195
- 267

Tushar Monirul
- 4,944
- 9
- 39
- 49
-
After you add words to the grammar you need rebuild the sources. You also need to add words to the dictionary. It's better to use latest version sphinx4-5prealpha, not 1.0beta6 – Nikolay Shmyrev Sep 30 '14 at 12:24
1 Answers
0
Open the helloworld.config.xml
file. In this xml file you have to change the location of the grammar file. Just find and make this line <property value="resource:/edu/cmu/sphinx/demo/helloworld/" name="grammarLocation"/>
to <property value="resource:/your/grammar/file/location" name="grammarLocation"/>
. And if you want to change the name of your grammar file hello.gram to ssomething else you have to change this line <property value="your file name" name="grammarName"/>
This should work.

Tushar Monirul
- 4,944
- 9
- 39
- 49
-
question is that. After updating the hello.gram file means by adding new words in gram file, the program does load or recognize the added words in hello.gram file. How can I load it as well? – Umar Asghar Nov 19 '15 at 10:08