Android tutorial - android text to speech - Example - android app development - android studio - android development tutorial
Definition of TextToSpeech:
- Text-to-speech (TTS) is a type of speech synthesis application that is used to create a spoken sound version of the text in a computer document, such as a help file or a Web page.
- TTS can enable the reading of computer display information for the visually challenged person, or may simply be used to augment the reading of a text message.
- Current TTS applications include voice-enabled e-mail and spoken prompts in voice response systems.
- TTS is often used with voice recognition programs.
- There are numerous TTS products available, including Read Please 2000, Proverbe Speech Unit, and Next Up Technology's TextAloud.
- Lucent, Elan, and AT&T each have products called "Text-to-Speech."
- TextToSpeech class is responsible to convert text into speech.
- It provides a lot of methods to control the speech such as setSpeedRate(), setPitch() etc.
- In this example, we are going to see the android texttospeech example with speed and pitch option.
activity_main.xml
- Drag 2 textviews, 1 edittext, 1 spinner and 1 button for the layout. Now the activity_main.xml file will look like this:
File: activity_main.xml
Activity class
- Let's see the code to speak the given text.