Code example for SpeechRecognizer

Methods: destroysetRecognitionListener

1
    public void cancel() { 
    	sr.cancel();
    } 
 
    public void destroy() { 
    	sr.setRecognitionListener(null);
    	sr.destroy();
    } 
 
    // --- RecognitionListener methods --- // 
 
    private ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
    @Override 
    public void onBeginningOfSpeech() { 
    } 
 
    @Override 
    public void onBufferReceived(byte[] buffer) {
        if(speechStarted > 0) {
Stop searching for code, let great code find you!  Add Codota to your java IDE