import edu.cmu.sphinx.util.TimeFrame; import edu.cmu.sphinx.api.AbstractSpeechRecognizer; import edu.cmu.sphinx.api.SpeechResult; sclass StreamSpeechRecognizer2 extends AbstractSpeechRecognizer { bool allocated; *(Configuration configuration) throws IOException { super(configuration); } public void startRecognition(InputStream stream) { startRecognition(stream, TimeFrame.INFINITE); } public void startRecognition(InputStream stream, TimeFrame timeFrame) { if (!allocated) { recognizer.allocate(); allocated = true; } context.setSpeechSource(stream, timeFrame); } public void stopRecognition() {} }