Code example for TextToSpeech

Methods: speak

0
 
	public void onInit(int status) {
		if (status == TextToSpeech.SUCCESS) {
			 
			int n = (int)(Math.random() * phrases.size());
			myTTS.speak(phrases.get(n), TextToSpeech.QUEUE_FLUSH, null);
 
		} else if (status == TextToSpeech.ERROR) {
			myTTS.shutdown();
		} 
	} 
}