0

I've been trying all day to get the Java Sphinx4 API to recognize my speech in real time, and it does. But it only does it once, after the program is opened. After it gets that first input, the program just freezes at recognizer.recognize();, even if I've used microphone.clear(); beforehand.

It doesn't matter what code I use. I've copied several examples from several sources, but they all do the same thing: Get one piece of my speech and then freeze at the next attempt to recognize. There was one time, though, where I let it sit for a few minutes and it registered a second time (though the result was blank). It didn't happen again, though.

I'm using a really crappy laptop. Is it just not capable of running this? I'd think if it could recognize a piece of speech, it could do more without hesitating. I have no idea what's wrong, so any help or suggestions would be greatly appreciated. :) Thanks!

TheBeocro
  • 121
  • 1
  • 1
  • 8

1 Answers1

1

Instead of blindly copying other sources why not read the official tutorial? Also the fact that you are mentioning recognizer.recognize() makes me think that your version of sphinx4 is outdated. In the latest version you use recognizer.startRecognition() and recognizer.stopRecognition().

Alexander Solovets
  • 2,447
  • 15
  • 22
  • Interesting. I thought their tutorial was out of date. Stupid mistake on my part, I suppose. I'll look into it tomorrow, thanks. – TheBeocro Nov 30 '15 at 05:21
  • Alright, I switched over to the latest version, and I have read the tutorial and the FAQ, but now it's worse: It gives me 30-ish warnings in the console that say "The dictionary is missing a phonetic transcription for the word ''." I'm using the default acoustic model, dictionary, and language model. I also set my grammar file via configuration.setGrammarPath("resource:/edu/cmu/sphinx/models/en-us/def.gram");. Despite all of this, it never responds to my voice. It throws no error about my mic or anything. It just freezes on liveSpeechRecognizer.getResult(). – TheBeocro Nov 30 '15 at 23:04
  • I think the error is pretty self-descriptive: some words you're using in the grammar are absent in the dictionary. – Alexander Solovets Dec 01 '15 at 00:33
  • Yeah, I know that, but does that stop the entire thing from working? It just said "warning," so I figured it would be fine. Additionally, like I said, I'm using the default _everything_ that came with Sphinx4. Why would some things be missing? – TheBeocro Dec 01 '15 at 01:02
  • If you just run demos provided in the source code, everything should work out of the box. If it doesn't, please go to github.com/cmusphinx/sphinx4 and file an issue. If made any changes I'd like to see those changes, because it's really hard to say what's going on on your side. Also, even though "missing word" is a warning, I wouldn't except normal application executaion. – Alexander Solovets Dec 01 '15 at 02:15
  • I ran the DialogDemo, and it gave me an error. After searching around, I discovered that apparently it's a bug in the demo itself (?!) because you can't have more than one recognizer on one mic, but the demo did. After I sorted that out by directly editing the demo to use one recognizer, it _still_ freezes on getResult(). I really don't know what to do. – TheBeocro Dec 01 '15 at 02:56
  • As I said, if the demo isn't working as expected you should go and file the issue on GitHub, but as far as I know it works just fine. It's possible to create as many recognizers for a single microphone source as you wish, you only need to ensure that only one of them is active ever single moment. – Alexander Solovets Dec 01 '15 at 04:53