Ich bin neu in diesem Thema und ich habe versucht, ein Beispielprojekt mit Sphinx4 Bibliotheken für Schritt nach diesem Tutorial Schritt zu bauen: Tutorial linkkeine solchen Verfahren Fehler getComponentNames
dann hielt ich aus der den gleichen Fehler aufweisen (run.xml)
der Code, den ich verwendet:
public static void main(String[] args) {
// TODO code application logic here
//configuration obj
Configuration configuration = new Configuration();
//path to acoustic model
configuration.setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/es-us");
//path to dictionary model
configuration.setDictionaryPath("/dictionary.dic");
//path to the language model
configuration.setLanguageModelPath("/languagemodel.lm");
//recognizer object, pass configuration object
try{
LiveSpeechRecognizer recognize = new LiveSpeechRecognizer(configuration);
recognize.startRecognition(true);
//create SpeechResult Obj
SpeechResult result;
//checking if recognizer jas recognized the speech
while((result = recognize.getResult())!=null){
//get the recognized speech
String command = result.getHypothesis();
//Match recognized speech with our commands
switch(command){
case "open file manager":
System.out.println("File manager Opened");
break;
case "close file manager":
System.out.println("File manager Closed");
break;
case "open browser":
System.out.println("Browser Opened");
break;
case "close browser":
System.out.println("Browser Closed");
break;
}
}
}catch(IOException e){}
}
der Fehler ich erhalte:
run:
Exception in thread "main" java.lang.NoSuchMethodError: edu.cmu.sphinx.util.props.ConfigurationManager.getComponentNames()Ljava/util/Set;
at edu.cmu.sphinx.util.props.ConfigurationManagerUtils.listAllsPropNames(ConfigurationManagerUtils.java:553)
at edu.cmu.sphinx.util.props.ConfigurationManagerUtils.setProperty(ConfigurationManagerUtils.java:610)
at edu.cmu.sphinx.api.Context.setLocalProperty(Context.java:191)
at edu.cmu.sphinx.api.Context.setAcousticModel(Context.java:88)
at edu.cmu.sphinx.api.Context.<init>(Context.java:61)
at edu.cmu.sphinx.api.Context.<init>(Context.java:45)
at edu.cmu.sphinx.api.AbstractSpeechRecognizer.<init>(AbstractSpeechRecognizer.java:44)
at edu.cmu.sphinx.api.LiveSpeechRecognizer.<init>(LiveSpeechRecognizer.java:34)
at speechrecognizer.SpeechRecognizer.main(SpeechRecognizer.java:40)
C:\Users\Sadeem\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:54: Java returned: 1
BUILD FAILED (total time: 0 seconds)
die Ursache war, aber keine neuen Ergebnisse
heruntergeladen ich die JAR-Dateien von dieser Website oss.sonatype.org
und ich hinzugefügt, um die file.dic, file.lm zum/src-Ordner und in einen separaten Ordner, wenn diese Figur.
Sie haben in Ihrem Klassenpfad widersprüchliche oder veraltete jars. Sie müssen mehr Informationen darüber angeben, welche speziellen Gefäße Sie verwenden, um weitere Hilfe zu erhalten. –
das sind die Gläser, die ich verwendet habe: - sphinx4-data-1.0.0.jar & - sphinx4-core-1.0.0.jar @NikolayShmyrev –