# TtsSpan.TextBuilder

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder#pubctors)\|[Methods](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder#inhmethods)  

# TtsSpan.TextBuilder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.TextBuilder "View this page in Kotlin")\|Java

`
public
static


class
TtsSpan.TextBuilder
`  
`


``


``

extends `[SemioticClassBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.SemioticClassBuilder)`<`[TtsSpan.TextBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder)`>


``


`

|---|---|---|----------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||||
| ↳ | [android.text.style.TtsSpan.Builder](https://developer.android.com/reference/android/text/style/TtsSpan.Builder)\<C extends[android.text.style.TtsSpan.SemioticClassBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.SemioticClassBuilder)\<?\>\> |||
|   | ↳ | [android.text.style.TtsSpan.SemioticClassBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.SemioticClassBuilder)\<[android.text.style.TtsSpan.TextBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder)\> ||
|   |   | ↳ | android.text.style.TtsSpan.TextBuilder |

<br />

*** ** * ** ***

A builder for TtsSpans of type[TtsSpan.TYPE_TEXT](https://developer.android.com/reference/android/text/style/TtsSpan#TYPE_TEXT).

## Summary

|                                                                                                                                                                                                                    ### Public constructors                                                                                                                                                                                                                     ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[TextBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder#TextBuilder())`() ` Creates a builder for a TtsSpan of type[TtsSpan.TYPE_TEXT](https://developer.android.com/reference/android/text/style/TtsSpan#TYPE_TEXT).                                                                                                                                                                                               |
| ` `[TextBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder#TextBuilder(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` text) ` Creates a TtsSpan of type[TtsSpan.TYPE_TEXT](https://developer.android.com/reference/android/text/style/TtsSpan#TYPE_TEXT)and sets the[TtsSpan.ARG_TEXT](https://developer.android.com/reference/android/text/style/TtsSpan#ARG_TEXT)argument. |

|                                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                                      ||
|----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[TtsSpan.TextBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder) | ` `[setText](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder#setText(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` text) ` Sets the[TtsSpan.ARG_TEXT](https://developer.android.com/reference/android/text/style/TtsSpan#ARG_TEXT)argument, the text to be synthesized. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[android.text.style.TtsSpan.SemioticClassBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.SemioticClassBuilder)` ` |------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` C` | ` `[setAnimacy](https://developer.android.com/reference/android/text/style/TtsSpan.SemioticClassBuilder#setAnimacy(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` animacy) ` Sets the animacy information for this instance.                     | | ` C` | ` `[setCase](https://developer.android.com/reference/android/text/style/TtsSpan.SemioticClassBuilder#setCase(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` grammaticalCase) ` Sets the grammatical case information for this instance.          | | ` C` | ` `[setGender](https://developer.android.com/reference/android/text/style/TtsSpan.SemioticClassBuilder#setGender(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` gender) ` Sets the gender information for this instance.                         | | ` C` | ` `[setMultiplicity](https://developer.android.com/reference/android/text/style/TtsSpan.SemioticClassBuilder#setMultiplicity(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` multiplicity) ` Sets the multiplicity information for this instance. | ||
| From class` `[android.text.style.TtsSpan.Builder](https://developer.android.com/reference/android/text/style/TtsSpan.Builder)` ` |----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[TtsSpan](https://developer.android.com/reference/android/text/style/TtsSpan) | ` `[build](https://developer.android.com/reference/android/text/style/TtsSpan.Builder#build())`() ` Returns a TtsSpan built from the parameters set by the setter methods.                                                                                                                                                                              | | ` C`                                                                             | ` `[setIntArgument](https://developer.android.com/reference/android/text/style/TtsSpan.Builder#setIntArgument(java.lang.String,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` arg, int value) ` Sets an argument to an int value.                                                                                       | | ` C`                                                                             | ` `[setLongArgument](https://developer.android.com/reference/android/text/style/TtsSpan.Builder#setLongArgument(java.lang.String,%20long))`(`[String](https://developer.android.com/reference/java/lang/String)` arg, long value) ` Sets an argument to a long value.                                                                                   | | ` C`                                                                             | ` `[setStringArgument](https://developer.android.com/reference/android/text/style/TtsSpan.Builder#setStringArgument(java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` arg, `[String](https://developer.android.com/reference/java/lang/String)` value) ` Sets an argument to a string value. | ||
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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*.                                                                                             | ||

## Public constructors

### TextBuilder

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

```
public TextBuilder ()
```

Creates a builder for a TtsSpan of type[TtsSpan.TYPE_TEXT](https://developer.android.com/reference/android/text/style/TtsSpan#TYPE_TEXT).

<br />

### TextBuilder

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

```
public TextBuilder (String text)
```

Creates a TtsSpan of type[TtsSpan.TYPE_TEXT](https://developer.android.com/reference/android/text/style/TtsSpan#TYPE_TEXT)and sets the[TtsSpan.ARG_TEXT](https://developer.android.com/reference/android/text/style/TtsSpan#ARG_TEXT)argument.

<br />

|                      Parameters                      ||
|--------|----------------------------------------------|
| `text` | `String`: The text to be synthesized. <br /> |

**See also:**

- [setText(String)](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder#setText(java.lang.String))

## Public methods

### setText

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

```
public TtsSpan.TextBuilder setText (String text)
```

Sets the[TtsSpan.ARG_TEXT](https://developer.android.com/reference/android/text/style/TtsSpan#ARG_TEXT)argument, the text to be synthesized.

<br />

|                          Parameters                           ||
|--------|-------------------------------------------------------|
| `text` | `String`: The string that will be synthesized. <br /> |

|                                                           Returns                                                            ||
|-------------------------------------------------------------------------------------------------------|-----------------------|
| [TtsSpan.TextBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.TextBuilder) | This instance. <br /> |