Code example for TextToSpeech

Methods: shutdown, stop

0
    public void onDestroy() 
    { 
        // Don't forget to shutdown! 
        if (mTts != null)
        { 
            mTts.stop();
            mTts.shutdown();
        } 
        super.onDestroy(); 
    } 
 
 
	@Override 
	public void onInit(int status) {
		// TODO Auto-generated method stub 
		if (status == TextToSpeech.SUCCESS) {
			int result = mTts.setLanguage(Locale.US);
		} else { 
            // Initialization failed. 
            Log.e("app", "Could not initialize TextToSpeech.");
        }