0
package sphinxtest;

import edu.cmu.sphinx.api.Configuration;

import edu.cmu.sphinx.api.LiveSpeechRecognizer;

import edu.cmu.sphinx.api.SpeechResult;

import java.io.IOException;

public class Sphinxtest {

/**
 * @param args the command line arguments
 * @throws java.io.IOException

 */
public static void main(String[] args) throws IOException {

    System.out.println("running");

    Configuration config = new Configuration();

     config.setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us");
     config.setDictionaryPath("C:\\Users\\sys\\Desktop\\3481.dic");
     config.setLanguageModelPath("C:\\Users\\sys\\Desktop\\3481.dic");

     LiveSpeechRecognizer rec = new LiveSpeechRecognizer (config);
     rec.startRecognition(true);

     SpeechResult spinput ;
     while ( ( spinput = rec.getResult() ) != null) {

         String command = spinput.getHypothesis();

         if (command.equalsIgnoreCase("click")){

             System.out.println("click command recieved");


         }




}

}

}``

Hrushi
  • 1
  • First question I'd ask is, what line if the exception on? And then, what variable is being used in that line? And then, where did that variable's value come from? Can it be null? – yshavit Apr 07 '18 at 18:02
  • I'm almost sure that the error is in spinput because it has no assigned value( I am a beginner so excuse me) but then should i outrightly just assign it some value first?if yes then what?? – Hrushi Apr 08 '18 at 03:02

0 Answers0