Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recognizing single characters into java using voice recognition

Is there any implementation in java to capture only characters? Will CMU Sphinx be able to do this? I've been trying with no luck at all. For a fact google speech API does a very poor job out of this. Characters like B,W,X are recognized but almost all the vowels are not! Any information is appreciated. Thanks!

like image 736
Rukshan Hassim Avatar asked Nov 20 '25 19:11

Rukshan Hassim


1 Answers

Write grammar letters.gram like this:

#JSGF V1.0;

grammar letters;

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

Use it sphinx4 like this:

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();

For more details check sphinx4 tutorial

like image 124
Nikolay Shmyrev Avatar answered Nov 22 '25 08:11

Nikolay Shmyrev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!