Skip to main content

speakText()

Converts text to speech using Android’s Text-to-Speech (TTS) engine. This is the primary method for providing voice feedback during automation.
string
required
The text to speak. Supports plain text only.
void
This function does not return a value.

Basic Usage

Practical Examples

Implementation Details

Source Location

MainActivity.kt:4936

TTS Engine

The function uses Android’s built-in TextToSpeech service, which:
  • Initializes on app startup
  • Supports multiple languages (based on device settings)
  • Queues messages if multiple calls are made rapidly
  • Requires TextToSpeech.OnInitListener callback
Speech synthesis is asynchronous. The function returns immediately while the device speaks in the background.

Best Practices

Short messages (under 10 words) are easier to understand and don’t delay automation flow.
If critical timing is needed, add a delay after speakText() to ensure the message completes.
Speech is invaluable for debugging automations on remote devices where you can’t see the screen.

Common Use Cases

Workflow Status

Announce each step of a multi-step automation:

Debug Mode

Provide verbose feedback during development:

User Notifications

Alert users to important events:

Limitations

  • Speech language depends on device TTS engine settings
  • Some devices may not have TTS engines installed
  • Speech output may be muted if device volume is low
  • Multiple rapid calls queue up rather than interrupting