sphinx4 icon indicating copy to clipboard operation
sphinx4 copied to clipboard

JSGF Engine

Open roddar92 opened this issue 6 years ago • 1 comments

Dear colleagues, I tried to start JSGF from Sphinx4 library. But I can't find a good demo with grammars and queries to check how it works.

Could you suggest me any instructions for launching JSGF engine?

Regards, Daria

roddar92 avatar Jan 14 '20 11:01 roddar92

Here is a demo about JSGF: https://github.com/cmusphinx/sphinx4/blob/8707586053de5c49ba0d698f949ba7e6b6c987ee/sphinx4-samples/src/main/java/edu/cmu/sphinx/demo/dialog/DialogDemo.java#L132-L185

The JSGF grammar file it uses: https://github.com/cmusphinx/sphinx4/blob/8707586053de5c49ba0d698f949ba7e6b6c987ee/sphinx4-samples/src/main/resources/edu/cmu/sphinx/demo/dialog/dialog.gram#L1-L29

If you are on Windows, you need to edit this file to start the demo: https://github.com/cmusphinx/sphinx4/blob/8707586053de5c49ba0d698f949ba7e6b6c987ee/sphinx4-core/src/main/java/edu/cmu/sphinx/api/SpeechSourceProvider.java#L15-L20

// Change the class to this
public class SpeechSourceProvider {
    private static final Microphone mic = new Microphone(16000, 16, true, false);

    Microphone getMicrophone() {
        return mic;
    }
}

See details for the bug: https://stackoverflow.com/questions/29121188/cant-access-microphone-while-running-dialog-demo-in-sphinx4-5prealpha

SwimmingTiger avatar Apr 17 '21 18:04 SwimmingTiger