Code example for SpeechRecognizer

Methods: destroy

0
            speechTimeout.cancel();
        }catch(NullPointerException e){
            //carry on 
        } 
        if (speech != null) {
            speech.destroy();
 
            speech = null;
        } 
    } 
 
    /* RecognitionListener interface implementation */ 
 
    @Override 
    public void onReadyForSpeech(Bundle params) {
       // Log.i(getClass().getName(), "onReadyForSpeech"); 
        // create and schedule the input speech timeout 
        speechTimeout = new Timer();
        speechTimeout.schedule(new SilenceTimer(), 3000);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            //mute the beep sound