KinectSpokenInput implements SpokenInput { @Override public void startRecognition(final DataModel model, SpeechRecognizerProperties speech, DtmfRecognizerProperties dtmf) throws NoresourceError, BadFetchError { try { recognizer.allocate(); } catch (KinectRecognizerException e) { throw new NoresourceError(e.getMessage(), e); } recognizer.startRecognition(); final SpokenInputEvent event = new RecognitionStartedEvent(this, null); fireInputEvent(event); LOGGER.info("kinect recognition started"); } KinectSpokenInput(); void setType(final String value); @Override String getType(); @Override void open(); @Override void activate(); @Override void passivate(); @Override void close(); @Override boolean isBusy(); @Override void connect(ConnectionInformation client); @Override void disconnect(ConnectionInformation client); @Override void startRecognition(final DataModel model,
            SpeechRecognizerProperties speech,
            DtmfRecognizerProperties dtmf); @Override void stopRecognition(); @Override void addListener(final SpokenInputListener listener); @Override void removeListener(final SpokenInputListener listener); @Override void activateGrammars(
            final Collection<GrammarImplementation<?>> grammars); @Override void deactivateGrammars(
            final Collection<GrammarImplementation<?>> grammars); @Override Collection<GrammarType> getSupportedGrammarTypes(); @Override GrammarImplementation<?> loadGrammar(URI uri, GrammarType type); @Override Collection<BargeInType> getSupportedBargeInTypes();  }
@Test public void testStartRecognition() throws JVoiceXMLEvent, Exception { final KinectSpokenInput input = new KinectSpokenInput(); final MockSpokenInputListener listener = new MockSpokenInputListener(); input.addListener(listener); input.open(); input.activate(); input.startRecognition(null, null, null); Assert.assertTrue(input.isBusy()); listener.waitSize(1, 10000); final SpokenInputEvent event1 = listener.get(0); Assert.assertEquals(RecognitionStartedEvent.EVENT_TYPE, event1.getEventType()); LOGGER.info("Say something!"); listener.waitSize(2, 10000); final SpokenInputEvent event2 = listener.get(1); Assert.assertEquals(RecognitionEvent.EVENT_TYPE, event2.getEventType()); input.passivate(); }