Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#constants) \| [Ctors](https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#pubctors) \| [Inherited Methods](https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#inhmethods)

# TextToSpeech.Engine

*** ** * ** ***

` public class TextToSpeech.Engine `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.speech.tts.TextToSpeech.Engine |

<br />

*** ** * ** ***

Constants and parameter names for controlling text-to-speech. These include:

- Intents to ask engine to install data or check its data and extras for a TTS engine's check data activity.
- Keys for the parameters passed with speak commands, e.g. `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_PARAM_UTTERANCE_ID`, `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_PARAM_STREAM`.
- A list of feature strings that engines might support, e.g `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_FEATURE_NETWORK_SYNTHESIS`. These values may be passed in to `https://developer.android.com/reference/android/speech/tts/TextToSpeech#speak(java.lang.CharSequence,%20int,%20android.os.Bundle,%20java.lang.String)` and `https://developer.android.com/reference/android/speech/tts/TextToSpeech#synthesizeToFile(java.lang.CharSequence,%20android.os.Bundle,%20android.os.ParcelFileDescriptor,%20java.lang.String)` to modify engine behaviour. The engine can be queried for the set of features it supports through `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)`.

Apps targeting Android 11 that use text-to-speech should declare `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#INTENT_ACTION_TTS_SERVICE` in the `queries` elements of their manifest:

```
<queries>
  ...
 <intent>
     <action android:name="android.intent.action.TTS_SERVICE" />
 </intent>
</queries>
```

<br />

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` Activity Action: Starts the activity from the platform TextToSpeech engine to verify the proper installation and availability of the resource files on the system. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_GET_SAMPLE_TEXT` Activity intent for getting some sample text to use for demonstrating TTS. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_INSTALL_TTS_DATA` Activity Action: Triggers the platform TextToSpeech engine to start the activity that installs the resource files on the device that are required for TTS to be operational. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_TTS_DATA_INSTALLED` Broadcast Action: broadcast to signal the change in the list of available languages or/and their features. |
| `int` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#CHECK_VOICE_DATA_BAD_DATA` *This constant was deprecated in API level 18. Use CHECK_VOICE_DATA_FAIL instead.* |
| `int` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#CHECK_VOICE_DATA_FAIL` Indicates failure when checking the installation status of the resources used by the TextToSpeech engine with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent. |
| `int` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#CHECK_VOICE_DATA_MISSING_DATA` *This constant was deprecated in API level 18. Use CHECK_VOICE_DATA_FAIL instead.* |
| `int` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#CHECK_VOICE_DATA_MISSING_VOLUME` *This constant was deprecated in API level 18. Use CHECK_VOICE_DATA_FAIL instead.* |
| `int` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#CHECK_VOICE_DATA_PASS` Indicates success when checking the installation status of the resources used by the TextToSpeech engine with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent. |
| `int` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#DEFAULT_STREAM` Default audio stream used when playing synthesized speech. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_AVAILABLE_VOICES` Extra information received with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent result where the TextToSpeech engine returns an ArrayList of all the available voices. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_CHECK_VOICE_DATA_FOR` *This constant was deprecated in API level 18. Redundant functionality, checking for existence of specific sets of voice data can be done on client side.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_SAMPLE_TEXT` Extra information received with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_GET_SAMPLE_TEXT` intent result where the TextToSpeech engine returns an String with sample text for requested voice |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_TTS_DATA_INSTALLED` *This constant was deprecated in API level 18. No longer in use. If client is interested in information about what changed, it should use the ACTION_CHECK_TTS_DATA intent to discover available voices.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_UNAVAILABLE_VOICES` Extra information received with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent result where the TextToSpeech engine returns an ArrayList of all the unavailable voices. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_VOICE_DATA_FILES` *This constant was deprecated in API level 18. TTS engine implementation detail, this information has no use for text-to-speech API client.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_VOICE_DATA_FILES_INFO` *This constant was deprecated in API level 18. TTS engine implementation detail, this information has no use for text-to-speech API client.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_VOICE_DATA_ROOT_DIRECTORY` *This constant was deprecated in API level 18. TTS engine implementation detail, this information has no use for text-to-speech API client.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#INTENT_ACTION_TTS_SERVICE` Intent for starting a TTS service. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_FEATURE_EMBEDDED_SYNTHESIS` *This constant was deprecated in API level 21. Starting from API level 21, to select embedded synthesis, call (`https://developer.android.com/reference/android/speech/tts/TextToSpeech#getVoices()`, find a suitable embedded voice (`https://developer.android.com/reference/android/speech/tts/Voice#isNetworkConnectionRequired()`) and pass it to `https://developer.android.com/reference/android/speech/tts/TextToSpeech#setVoice(android.speech.tts.Voice)`).* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_FEATURE_NETWORK_RETRIES_COUNT` Feature key that indicates that network request retries count can be set for the request. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_FEATURE_NETWORK_SYNTHESIS` *This constant was deprecated in API level 21. Starting from API level 21, to select network synthesis, call `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getVoices()`, find a suitable network voice (`https://developer.android.com/reference/android/speech/tts/Voice#isNetworkConnectionRequired()`) and pass it to `https://developer.android.com/reference/android/speech/tts/TextToSpeech#setVoice(android.speech.tts.Voice)`.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_FEATURE_NETWORK_TIMEOUT_MS` Feature key that indicate that a network timeout can be set for the request. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_FEATURE_NOT_INSTALLED` Feature key that indicates that the voice may need to download additional data to be fully functional. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_PARAM_PAN` Parameter key to specify how the speech is panned from left to right when speaking text. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_PARAM_SESSION_ID` Parameter key to specify an audio session identifier (obtained from `https://developer.android.com/reference/android/media/AudioManager#generateAudioSessionId()`) that will be used by the request audio output. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_PARAM_STREAM` Parameter key to specify the audio stream type to be used when speaking text or playing back a file. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_PARAM_UTTERANCE_ID` Parameter key to identify an utterance in the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.OnUtteranceCompletedListener` after text has been spoken, a file has been played back or a silence duration has elapsed. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#KEY_PARAM_VOLUME` Parameter key to specify the speech volume relative to the current stream type volume used when speaking text. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#SERVICE_META_DATA` Name under which a text to speech engine publishes information about itself. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#Engine()() ` |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### ACTION_CHECK_TTS_DATA

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_CHECK_TTS_DATA
```

Activity Action: Starts the activity from the platform TextToSpeech engine to verify the proper installation and availability of the resource files on the system. Upon completion, the activity will return one of the following codes: `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#CHECK_VOICE_DATA_PASS`, `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#CHECK_VOICE_DATA_FAIL`,

Moreover, the data received in the activity result will contain the following fields:

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_AVAILABLE_VOICES` which contains an ArrayList of all the available voices. The format of each voice is: lang-COUNTRY-variant where COUNTRY and variant are optional (ie, "eng" or "eng-USA" or "eng-USA-FEMALE").
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_UNAVAILABLE_VOICES` which contains an ArrayList of all the unavailable voices (ones that user can install). The format of each voice is: lang-COUNTRY-variant where COUNTRY and variant are optional (ie, "eng" or "eng-USA" or "eng-USA-FEMALE").

<br />

<br />

Constant Value: "android.speech.tts.engine.CHECK_TTS_DATA"

### ACTION_GET_SAMPLE_TEXT

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_GET_SAMPLE_TEXT
```

Activity intent for getting some sample text to use for demonstrating TTS. Specific locale have to be requested by passing following extra parameters:

- language
- country
- variant

Upon completion, the activity result may contain the following fields:

<!-- -->

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#EXTRA_SAMPLE_TEXT` which contains an String with sample text.

<br />

<br />

Constant Value: "android.speech.tts.engine.GET_SAMPLE_TEXT"

### ACTION_INSTALL_TTS_DATA

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_INSTALL_TTS_DATA
```

Activity Action: Triggers the platform TextToSpeech engine to start the activity that installs the resource files on the device that are required for TTS to be operational. Since the installation of the data can be interrupted or declined by the user, the application shouldn't expect successful installation upon return from that intent, and if need be, should check installation status with `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA`.

<br />

Constant Value: "android.speech.tts.engine.INSTALL_TTS_DATA"

### ACTION_TTS_DATA_INSTALLED

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_TTS_DATA_INSTALLED
```

Broadcast Action: broadcast to signal the change in the list of available languages or/and their features.

<br />

Constant Value: "android.speech.tts.engine.TTS_DATA_INSTALLED"

### CHECK_VOICE_DATA_BAD_DATA

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CHECK_VOICE_DATA_BAD_DATA
```

<br />

**This constant was deprecated in API level 18.**   

Use CHECK_VOICE_DATA_FAIL instead.

Indicates erroneous data when checking the installation status of the resources used by the TextToSpeech engine with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent.

<br />

Constant Value: -1 (0xffffffff)

### CHECK_VOICE_DATA_FAIL

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CHECK_VOICE_DATA_FAIL
```

Indicates failure when checking the installation status of the resources used by the TextToSpeech engine with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent.

<br />

Constant Value: 0 (0x00000000)

### CHECK_VOICE_DATA_MISSING_DATA

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CHECK_VOICE_DATA_MISSING_DATA
```

<br />

**This constant was deprecated in API level 18.**   

Use CHECK_VOICE_DATA_FAIL instead.

Indicates missing resources when checking the installation status of the resources used by the TextToSpeech engine with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent.

<br />

Constant Value: -2 (0xfffffffe)

### CHECK_VOICE_DATA_MISSING_VOLUME

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CHECK_VOICE_DATA_MISSING_VOLUME
```

<br />

**This constant was deprecated in API level 18.**   

Use CHECK_VOICE_DATA_FAIL instead.

Indicates missing storage volume when checking the installation status of the resources used by the TextToSpeech engine with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent.

<br />

Constant Value: -3 (0xfffffffd)

### CHECK_VOICE_DATA_PASS

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CHECK_VOICE_DATA_PASS
```

Indicates success when checking the installation status of the resources used by the TextToSpeech engine with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent.

<br />

Constant Value: 1 (0x00000001)

### DEFAULT_STREAM

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DEFAULT_STREAM
```

Default audio stream used when playing synthesized speech.

<br />

Constant Value: 3 (0x00000003)

### EXTRA_AVAILABLE_VOICES

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_AVAILABLE_VOICES
```

Extra information received with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent result where the TextToSpeech engine returns an ArrayList of all the available voices. The format of each voice is: lang-COUNTRY-variant where COUNTRY and variant are optional (ie, "eng" or "eng-USA" or "eng-USA-FEMALE").

<br />

Constant Value: "availableVoices"

### EXTRA_CHECK_VOICE_DATA_FOR

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_CHECK_VOICE_DATA_FOR
```

<br />

**This constant was deprecated in API level 18.**   

Redundant functionality, checking for existence of specific sets of voice data can be done on client side.

Extra information sent with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent where the caller indicates to the TextToSpeech engine which specific sets of voice data to check for by sending an ArrayList of the voices that are of interest. The format of each voice is: lang-COUNTRY-variant where COUNTRY and variant are optional (ie, "eng" or "eng-USA" or "eng-USA-FEMALE").

<br />

Constant Value: "checkVoiceDataFor"

### EXTRA_SAMPLE_TEXT

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_SAMPLE_TEXT
```

Extra information received with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_GET_SAMPLE_TEXT` intent result where the TextToSpeech engine returns an String with sample text for requested voice

<br />

Constant Value: "sampleText"

### EXTRA_TTS_DATA_INSTALLED

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_TTS_DATA_INSTALLED
```

<br />

**This constant was deprecated in API level 18.**   

No longer in use. If client is interested in information about what changed, it should use the ACTION_CHECK_TTS_DATA intent to discover available voices.

Extra information received with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_TTS_DATA_INSTALLED` intent result. It indicates whether the data files for the synthesis engine were successfully installed. The installation was initiated with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_INSTALL_TTS_DATA` intent. The possible values for this extra are `https://developer.android.com/reference/android/speech/tts/TextToSpeech#SUCCESS` and `https://developer.android.com/reference/android/speech/tts/TextToSpeech#ERROR`.

<br />

Constant Value: "dataInstalled"

### EXTRA_UNAVAILABLE_VOICES

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_UNAVAILABLE_VOICES
```

Extra information received with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent result where the TextToSpeech engine returns an ArrayList of all the unavailable voices. The format of each voice is: lang-COUNTRY-variant where COUNTRY and variant are optional (ie, "eng" or "eng-USA" or "eng-USA-FEMALE").

<br />

Constant Value: "unavailableVoices"

### EXTRA_VOICE_DATA_FILES

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_VOICE_DATA_FILES
```

<br />

**This constant was deprecated in API level 18.**   

TTS engine implementation detail, this information has no use for text-to-speech API client.

Extra information received with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent result where the TextToSpeech engine specifies the file names of its resources under the resource path.

<br />

Constant Value: "dataFiles"

### EXTRA_VOICE_DATA_FILES_INFO

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_VOICE_DATA_FILES_INFO
```

<br />

**This constant was deprecated in API level 18.**   

TTS engine implementation detail, this information has no use for text-to-speech API client.

Extra information received with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent result where the TextToSpeech engine specifies the locale associated with each resource file.

<br />

Constant Value: "dataFilesInfo"

### EXTRA_VOICE_DATA_ROOT_DIRECTORY

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_VOICE_DATA_ROOT_DIRECTORY
```

<br />

**This constant was deprecated in API level 18.**   

TTS engine implementation detail, this information has no use for text-to-speech API client.

Extra information received with the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine#ACTION_CHECK_TTS_DATA` intent result where the TextToSpeech engine specifies the path to its resources. It may be used by language packages to find out where to put their data.

<br />

Constant Value: "dataRoot"

### INTENT_ACTION_TTS_SERVICE

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String INTENT_ACTION_TTS_SERVICE
```

Intent for starting a TTS service. Services that handle this intent must extend `https://developer.android.com/reference/android/speech/tts/TextToSpeechService`. Normal applications should not use this intent directly, instead they should talk to the TTS service using the the methods in this class.

<br />

Constant Value: "android.intent.action.TTS_SERVICE"

### KEY_FEATURE_EMBEDDED_SYNTHESIS

Added in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String KEY_FEATURE_EMBEDDED_SYNTHESIS
```

<br />

**This constant was deprecated in API level 21.**   

Starting from API level 21, to select embedded synthesis, call (`https://developer.android.com/reference/android/speech/tts/TextToSpeech#getVoices()`, find a suitable embedded voice (`https://developer.android.com/reference/android/speech/tts/Voice#isNetworkConnectionRequired()`) and pass it to `https://developer.android.com/reference/android/speech/tts/TextToSpeech#setVoice(android.speech.tts.Voice)`).

Feature key for embedded synthesis. See `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)` for a description of how feature keys work. If set and supported by the engine as per `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)`, the engine must synthesize text on-device (without making network requests).

<br />

**See also:**

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#speak(java.lang.CharSequence,%20int,%20android.os.Bundle,%20java.lang.String)`
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#synthesizeToFile(java.lang.String,%20java.util.HashMap<java.lang.String,java.lang.String>,%20java.lang.String)`
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)`

Constant Value: "embeddedTts"

### KEY_FEATURE_NETWORK_RETRIES_COUNT

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String KEY_FEATURE_NETWORK_RETRIES_COUNT
```

Feature key that indicates that network request retries count can be set for the request. If set and supported as per `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)` or `https://developer.android.com/reference/android/speech/tts/Voice#getFeatures()`, it can be used as a request parameter to set the number of network request retries that are attempted in case of failure. When used as a key of a request parameter, its value should be a string with an integer value.

<br />

**See also:**

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)`
- `https://developer.android.com/reference/android/speech/tts/Voice#getFeatures()`

Constant Value: "networkRetriesCount"

### KEY_FEATURE_NETWORK_SYNTHESIS

Added in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String KEY_FEATURE_NETWORK_SYNTHESIS
```

<br />

**This constant was deprecated in API level 21.**   

Starting from API level 21, to select network synthesis, call `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getVoices()`, find a suitable network voice (`https://developer.android.com/reference/android/speech/tts/Voice#isNetworkConnectionRequired()`) and pass it to `https://developer.android.com/reference/android/speech/tts/TextToSpeech#setVoice(android.speech.tts.Voice)`.

Feature key for network synthesis. See `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)` for a description of how feature keys work. If set (and supported by the engine as per `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)`, the engine must use network based synthesis.

<br />

**See also:**

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#speak(java.lang.CharSequence,%20int,%20android.os.Bundle,%20java.lang.String)`
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#synthesizeToFile(java.lang.String,%20java.util.HashMap<java.lang.String,java.lang.String>,%20java.lang.String)`
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)`

Constant Value: "networkTts"

### KEY_FEATURE_NETWORK_TIMEOUT_MS

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String KEY_FEATURE_NETWORK_TIMEOUT_MS
```

Feature key that indicate that a network timeout can be set for the request. If set and supported as per `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)` or `https://developer.android.com/reference/android/speech/tts/Voice#getFeatures()`, it can be used as request parameter to set the maximum allowed time for a single request attempt, in milliseconds, before synthesis fails. When used as a key of a request parameter, its value should be a string with an integer value.

<br />

**See also:**

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)`
- `https://developer.android.com/reference/android/speech/tts/Voice#getFeatures()`

Constant Value: "networkTimeoutMs"

### KEY_FEATURE_NOT_INSTALLED

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String KEY_FEATURE_NOT_INSTALLED
```

Feature key that indicates that the voice may need to download additional data to be fully functional. The download will be triggered by calling `https://developer.android.com/reference/android/speech/tts/TextToSpeech#setVoice(android.speech.tts.Voice)` or `https://developer.android.com/reference/android/speech/tts/TextToSpeech#setLanguage(java.util.Locale)`. Until download is complete, each synthesis request will either report `https://developer.android.com/reference/android/speech/tts/TextToSpeech#ERROR_NOT_INSTALLED_YET` error, or use a different voice to synthesize the request. This feature should NOT be used as a key of a request parameter.

<br />

**See also:**

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#getFeatures(java.util.Locale)`
- `https://developer.android.com/reference/android/speech/tts/Voice#getFeatures()`

Constant Value: "notInstalled"

### KEY_PARAM_PAN

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String KEY_PARAM_PAN
```

Parameter key to specify how the speech is panned from left to right when speaking text. Pan is specified as a float ranging from -1 to +1 where -1 maps to a hard-left pan, 0 to center (the default behavior), and +1 to hard-right.

<br />

**See also:**

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#speak(java.lang.CharSequence,%20int,%20android.os.Bundle,%20java.lang.String)`
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#playEarcon(java.lang.String,%20int,%20java.util.HashMap<java.lang.String,java.lang.String>)`

Constant Value: "pan"

### KEY_PARAM_SESSION_ID

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String KEY_PARAM_SESSION_ID
```

Parameter key to specify an audio session identifier (obtained from `https://developer.android.com/reference/android/media/AudioManager#generateAudioSessionId()`) that will be used by the request audio output. It can be used to associate one of the `https://developer.android.com/reference/android/media/audiofx/AudioEffect` objects with the synthesis (or earcon) output.

<br />

**See also:**

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#speak(java.lang.CharSequence,%20int,%20android.os.Bundle,%20java.lang.String)`
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#playEarcon(java.lang.String,%20int,%20java.util.HashMap<java.lang.String,java.lang.String>)`

Constant Value: "sessionId"

### KEY_PARAM_STREAM

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String KEY_PARAM_STREAM
```

Parameter key to specify the audio stream type to be used when speaking text or playing back a file. The value should be one of the STREAM_ constants defined in `https://developer.android.com/reference/android/media/AudioManager`.

<br />

**See also:**

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#speak(java.lang.CharSequence,%20int,%20android.os.Bundle,%20java.lang.String)`
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#playEarcon(java.lang.String,%20int,%20java.util.HashMap<java.lang.String,java.lang.String>)`

Constant Value: "streamType"

### KEY_PARAM_UTTERANCE_ID

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String KEY_PARAM_UTTERANCE_ID
```

Parameter key to identify an utterance in the `https://developer.android.com/reference/android/speech/tts/TextToSpeech.OnUtteranceCompletedListener` after text has been spoken, a file has been played back or a silence duration has elapsed.

<br />

**See also:**

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#speak(java.lang.CharSequence,%20int,%20android.os.Bundle,%20java.lang.String)`
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#playEarcon(java.lang.String,%20int,%20java.util.HashMap<java.lang.String,java.lang.String>)`
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#synthesizeToFile(java.lang.String,%20java.util.HashMap<java.lang.String,java.lang.String>,%20java.lang.String)`

Constant Value: "utteranceId"

### KEY_PARAM_VOLUME

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String KEY_PARAM_VOLUME
```

Parameter key to specify the speech volume relative to the current stream type volume used when speaking text. Volume is specified as a float ranging from 0 to 1 where 0 is silence, and 1 is the maximum volume (the default behavior).

<br />

**See also:**

- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#speak(java.lang.CharSequence,%20int,%20android.os.Bundle,%20java.lang.String)`
- `https://developer.android.com/reference/android/speech/tts/TextToSpeech#playEarcon(java.lang.String,%20int,%20java.util.HashMap<java.lang.String,java.lang.String>)`

Constant Value: "volume"

### SERVICE_META_DATA

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String SERVICE_META_DATA
```

Name under which a text to speech engine publishes information about itself. This meta-data should reference an XML resource containing a ``<`https://developer.android.com/reference/android/R.styleable#TextToSpeechEngine`>`` tag.

<br />

Constant Value: "android.speech.tts"

## Public constructors

### Engine

```
public Engine ()
```

<br />

<br />