You need to break the word with a word and highlight the specified word. E.g. if we take a sentence like "You did not type text":
tts.speak("You", TextToSpeech.QUEUE_FLUSH, null); /*Change size or color of "You" in your TextView for eg*/ tts.speak("haven't", TextToSpeech.QUEUE_FLUSH, null); /*Change size or color of "haven't" in your TextView for eg*/ tts.speak("typed", TextToSpeech.QUEUE_FLUSH, null); /*Change size or color of "typed" in your TextView for eg*/ ...
You can do this using txtText.getText().toString().Split" "; to return an array of strings of words separated by a space. Then go through this array to find out which word is spoken, and select it in the TextView, for example,
source share