Using Text-to-Speech

Learn:

  • Text-to-Speech

Starting with Android 1.6 (API Level 4), the Android platform includes a new Text-to-Speech (TTS) capability. Also known as "speech synthesis", TTS enables your Android device to "speak" text of different languages.

This example is included with the Py4A installation

speak.py

import android droid = android.Android() message = droid.dialogGetInput('TTS', 'What would you like to say?').result droid.ttsSpeak(message)

Code Explained

The user's text is spoken

Python for Android
| TOC | 1 | 2 | 3 | 4 | 5 |