Code example for SpeechRecognizer

Methods: destroy

0
    } 
 
    @Override 
    protected void onStop() { 
        super.onStop(); 
        sr.destroy();
    } 
 
    @Override 
    public void onEndOfSpeech() { 
        pd.dismiss();
 
        if(speechStarted == 0)
            return; 
 
        long delta = System.currentTimeMillis() - speechStarted;
 
        int sampleRate = (int) (baos.size() * 1000 / delta);
        sampleRate = 8000; // THIS IS A MAGIC NUMBER@?!!?!?!
        // can i has calculate?