Skip to content

Unable to recognise the Live stream voice using sphinx4 #103

@NaveenKumar997

Description

@NaveenKumar997

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions