Android TextToSpeech ExampleTextToSpeech 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.xmlDrag 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 classLet's see the code to speak the given text. File: MainActivity.java
You need to run it on the Real Device (e.g. Mobile) to test the application.
Next TopicAndroid Telephony Manager Tutorial
|
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week