Closed rpereira-dev closed 6 years ago
You are using some outdated sources and code. Follow our tutorial
My sources weren't outdated (as I'm using gradle and latest maven's version)
However, changing my code this way solved the issue:
Configuration configuration = new Configuration();
configuration.setAcousticModelPath("./res/sphinx4/fr/model");
configuration.setDictionaryPath("./res/sphinx4/fr/fr.dict");
configuration.setUseGrammar(true);
configuration.setGrammarPath("./res/sphinx4/fr/");
configuration.setGrammarName("fr");
LiveSpeechRecognizer jsgfRecognizer = new LiveSpeechRecognizer(configuration);
jsgfRecognizer.startRecognition(true);
while (true) {
String utterance = jsgfRecognizer.getResult().getHypothesis();
System.out.println(utterance);
}`
Is ConfigurationManager class deprecated?
It is not deprecated but private.
In file /linguist/acoustic/tiedstate/tiedmixture/MixtureComponentSet.java , l. 90, in method:
private void insertTopComponent(PrunableMixtureComponent[] topComponents, PrunableMixtureComponent component)
In my program, the for loop, the if condition is entered on first loop iteration (having i = 0), which is causing a crash of my application:
Though, I'm not sure that this behaviour was supposed to happen (maybe I did something wrong when using the API)
The code causing the crash: