Code example for TextToSpeech

Methods: isSpeaking, speak, stop

0
	 *  
	 * @param textToSpeech the text to speech 
	 */ 
	public void speakText(String textToSpeech) {
		if (mTts != null) {
			if (mTts.isSpeaking()) {
				mTts.stop();
			} 
			if (checkTTSSupportLanguage() && !checkKeyguardMode()) { 
				mTts.speak(textToSpeech, TextToSpeech.QUEUE_FLUSH, null);
			} 
		}else{ 
			startTts(); 
		} 
	} 
 
	/** 
	 * Speak text on handler. 
	 *  
	 * @param textToSpeech the text to speech 
	 */