<div class="meta" robots="noindex">

</div>

Method

# Speak

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `System.Speak<system.speak>` as a replacement.

</div>

## Description

Uses the built-in speech synthesizer to pronounce the passed text string.

## Usage

Speak(*phrase* *\[,Interrupt\]*)

| Part          | Type                                                                                       | Description                                                                                                                 |
|---------------|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| **phrase**    | [String](http://developer.xojo.com/string) or [Variant](http://developer.xojo.com/variant) | Text string to be passed to the speech synthesizer. Speak will accept any variant that can be expressed as a string.        |
| **Interrupt** | [Boolean](http://developer.xojo.com/boolean)                                               | Optional interrupt flag. If set to True, the call will terminate the previous calls to Speak. If omitted, False is assumed. |

## Notes

Speak takes a string (or any variant that can be expressed as a string) and uses the Windows or Macintosh text-to-speech engine to <span class="title-ref">Speak</span> the text. The speech is asynchronous, allowing normal program flow to continue. By default, subsequent calls to <span class="title-ref">Speak</span> before the first call has finished will queue up and <span class="title-ref">Speak</span> after the completion of the previous call. If the optional interrupt flag is used and set to True, the previous <span class="title-ref">Speak</span> calls will be stopped immediately.

On Linux, <span class="title-ref">Speak</span> uses the [eSpeak](http://espeak.sourceforge.net/) library which is installed by default on Ubuntu 10.04 and newer.

## Sample code

The following code in a `PushButton</api/deprecated/pushbutton>` pronounces the phrase entered into a `TextField</api/deprecated/textfield>`.

``` xojo
If TextField1.Text <> "" Then
  Speak(TextField1.Text)
Else
  Speak("Please enter some text in the field!")
End If
```

## Compatibility

All project types on all supported operating systems.

## See also

`IDE Scripting Speak command<ide_scripting_notification_commands.speak>`
