3

java中是否有任何实现只捕获字符?CMU Sphinx能做到这一点吗?我一直在尝试,完全没有运气。事实上,谷歌语音 API 在这方面做得很差。B、W、X 等字符可以识别,但几乎所有元音都不能识别!任何信息表示赞赏。谢谢!

4

1 回答 1

1

像这样写语法letters.gram

#JSGF V1.0;

grammar letters;

public <letter> = (a. | b. | c. | d. | e. | f. | j.) *;

像这样使用 sphinx4:

Configuration configuration = new Configuration();
configuration.setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us");
configuration.setDictionaryPath("resource:/edu/cmu/sphinx/models/en-us/cmudict-en-us.dict");
configuration.setGrammarPath("file:grammars_folder");
configuration.setGrammarName("letters");
configuration.setUseGrammar(true);

LiveSpeechRecognizer recognizer = new LiveSpeechRecognizer(configuration);
recognizer.startRecognition(true);
SpeechResult result = recognizer.getResult();
recognizer.stopRecognition();

有关更多详细信息,请查看sphinx4 教程

于 2016-06-16T23:08:24.457 回答