Code example for TextToSpeech

Methods: isSpeaking, setOnUtteranceCompletedListener, speak

0
			return; 
		 
		if (tts == null)
			return; 
		 
		tts.setOnUtteranceCompletedListener(this);
		activeText = "ignore";
		if (tts.isSpeaking() == false)
			tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
    	 
	} 
	 
	 
	public boolean isTTSAvailable() 
	{ 
		int val = tts.isLanguageAvailable(Locale.getDefault());
		 
		if (val == TextToSpeech.LANG_MISSING_DATA)// || (val == TextToSpeech.LANG_NOT_SUPPORTED))
			return false; 
		 
		return true;