im trying to run a Sphinx's HelloWOrd program, it needs a .jar file to work.
im trying to add a jar file in the classpath, but im getting some errors
contend.util does not exist import edu.cmu.sphinx.frontend.util.Microphone; ^ home/karen/workspace/hola/src/hola/HelloWorld.java:4: package edu.cmu.sphinx.recognizer does not exist import edu.cmu.sphinx.recognizer.Recognizer; ^ home/karen/workspace/hola/src/hola/HelloWorld.java:5: package edu.cmu.sphinx.result does not exist import edu.cmu.sphinx.result.Result; ^ home/karen/workspace/hola/src/hola/HelloWorld.java:6: package edu.cmu.sphinx.util.props does not exist import edu.cmu.sphinx.util.props.ConfigurationManager; ^ home/karen/workspace/hola/src/hola/HelloWorld.java:11: cannot find symbol symbol : class ConfigurationManager location: class hola.HelloWorld ConfigurationManager cm; ^ home/karen/workspace/hola/src/hola/HelloWorld.java:14: cannot find symbol symbol : class ConfigurationManager location: class hola.HelloWorld cm = new ConfigurationManager(args[0]); ^ home/karen/workspace/hola/src/hola/HelloWorld.java:16: cannot find symbol symbol : class ConfigurationManager location: class hola.HelloWorld cm = new ConfigurationManager(HelloWorld.class.getResource("helloworld.config.xml")); ^ home/karen/workspace/hola/src/hola/HelloWorld.java:19: cannot find symbol symbol : class Recognizer location: class hola.HelloWorld Recognizer recognizer = (Recognizer) cm.lookup("recognizer"); ^ home/karen/workspace/hola/src/hola/HelloWorld.java:19: cannot find symbol symbol : class Recognizer location: class hola.HelloWorld Recognizer recognizer = (Recognizer) cm.lookup("recognizer"); ^ home/karen/workspace/hola/src/hola/HelloWorld.java:23: cannot find symbol symbol : class Microphone location: class hola.HelloWorld Microphone microphone = (Microphone) cm.lookup("microphone"); ^ home/karen/workspace/hola/src/hola/HelloWorld.java:23: cannot find symbol symbol : class Microphone location: class hola.HelloWorld Microphone microphone = (Microphone) cm.lookup("microphone"); ^ home/karen/workspace/hola/src/hola/HelloWorld.java:36: cannot find symbol symbol : class Result location: class hola.HelloWorld Result result = recognizer.recognize(); ^ 12 errors
my question is: I have to add all the packages that needs my project or only the jar file and the main class?
Sugest please!
This is the HelloWord Program:
package hola;
import edu.cmu.sphinx.frontend.util.Microphone;
import edu.cmu.sphinx.recognizer.Recognizer;
import edu.cmu.sphinx.result.Result;
import edu.cmu.sphinx.util.props.ConfigurationManager;
public class HelloWorld {
public static void main(String [] args){
System.out.println("VIcente y karen");
ConfigurationManager cm;
System.out.println("Karen entiende esto");
if (args.length > 0) {
cm = new ConfigurationManager(args[0]);
} else {
cm = new ConfigurationManager(HelloWorld.class.getResource("helloworld.config.xml"));
}
Recognizer recognizer = (Recognizer) cm.lookup("recognizer");
recognizer.allocate();
// start the microphone or exit if the programm if this is not possible
Microphone microphone = (Microphone) cm.lookup("microphone");
if (!microphone.startRecording()) {
System.out.println("Cannot start microphone.");
recognizer.deallocate();
System.exit(1);
}
System.out.println("Say: (Good morning | Hello) ( Bhiksha | Evandro | Paul | Philip | Rita | Will )");
// loop the recognition until the programm exits.
while (true) {
System.out.println("Start speaking. Press Ctrl-C to quit.\n");
Result result = recognizer.recognize();
if (result != null) {
String resultText = result.getBestFinalResultNoFiller();
System.out.println("You said: " + resultText + '\n');
} else {
System.out.println("I can't hear what you said.\n");
}
}
}
}