Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to recognise the Live stream voice using sphinx4 #103

Open
NaveenKumar997 opened this issue Feb 5, 2021 · 2 comments
Open

Unable to recognise the Live stream voice using sphinx4 #103

NaveenKumar997 opened this issue Feb 5, 2021 · 2 comments

Comments

@NaveenKumar997
Copy link

NaveenKumar997 commented Feb 5, 2021

I have created code based on this tutorial https://cmusphinx.github.io/wiki/tutorialsphinx4/

performing Speech to text from a .wav file using StreamSpeechRecognizer works fine but I am facing issue with LiveSpeechRecognizer , In debug the code goes till recognizer.startRecognition(true); and never moves further , I am runnning this on intellij and using mac os Catalina

I suspect mac os or intellij is not allowing the file to use microphone

Code :

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.setLanguageModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us.lm.bin");

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

while ((result = recognizer.getResult()) != null) {
    System.out.println("speech recognition started");
    System.out.println(result.getHypothesis());
}
recognizer.stopRecognition();
@cailalex
Copy link

cailalex commented Nov 5, 2021

I've been experiencing the same issue. Debugger never moves past recognizer.startRecognition();

However, when I place print statements in my code to confirm which statements have successfully executed, I've found that the recognizer.startRecognition() is successful, but the line where the program stops for me is while ((result = recognizer.getResult()) != null). The program does not move inside the while loop, nor does it pass it. It seems to be stuck on .getResult().

Came to the same conclusion - could be an issue with accessing my device's microphone? Question to the team: is there any way for developers to set/test this?

@petercwallis
Copy link

Same issue ... 6 months later. And yes some indication that the microphone is (not) working would be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants