Search code examples
javaspeech-recognitionspeech-to-textsphinx4

Which Demo code in Sphinx 4 is more appropriate for Real time Speech to Text Conversion?


I am working on the Java Sphinx4 API to recognize my speech in real time,I have gone through all the demo available with the source file,But I couldn't identify which demo to work on.

And How can I use transcribe demo to take input wav file real time and convert it into text.

I am working on a Speech Enabled Simulation Interface , Which requires pilot commands to get convert into text at Real time.

Any type of help is highly appreciate.


Solution

  • Look here under Configuration section. You should be able to convert TranscriberDemo.java to use the following.

    LiveSpeechRecognizer uses microphone as the speech source.

    LiveSpeechRecognizer recognizer = new LiveSpeechRecognizer(configuration);
    // Start recognition process pruning previously cached data.
    recognizer.startRecognition(true);
    SpeechResult result = recognizer.getResult();
    // Pause recognition process. It can be resumed then with startRecognition(false).
    recognizer.stopRecognition();