# TtsSpan.DurationBuilder

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

# TtsSpan.DurationBuilder

*** ** * ** ***

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

`
public
static


class
TtsSpan.DurationBuilder
`  
`


``


``

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


``


`

|---|---|---|--------------------------------------------|
| [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.DurationBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder)\> ||
|   |   | ↳ | android.text.style.TtsSpan.DurationBuilder |

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                               ### Public constructors                                                                                                                                ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[DurationBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder#DurationBuilder())`() ` Creates a builder for a TtsSpan of type[TtsSpan.TYPE_DURATION](https://developer.android.com/reference/android/text/style/TtsSpan#TYPE_DURATION). |

|                                                                                                                                                                              ### Public methods                                                                                                                                                                              ||
|------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[TtsSpan.DurationBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder) | ` `[setHours](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder#setHours(int))`(int hours) ` Sets the[TtsSpan.ARG_HOURS](https://developer.android.com/reference/android/text/style/TtsSpan#ARG_HOURS)argument.           |
| ` `[TtsSpan.DurationBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder) | ` `[setMinutes](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder#setMinutes(int))`(int minutes) ` Sets the[TtsSpan.ARG_MINUTES](https://developer.android.com/reference/android/text/style/TtsSpan#ARG_MINUTES)argument. |
| ` `[TtsSpan.DurationBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder) | ` `[setSeconds](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder#setSeconds(int))`(int seconds) ` Sets the[TtsSpan.ARG_SECONDS](https://developer.android.com/reference/android/text/style/TtsSpan#ARG_SECONDS)argument. |

| ### 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

### DurationBuilder

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

```
public DurationBuilder ()
```

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

<br />

## Public methods

### setHours

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

```
public TtsSpan.DurationBuilder setHours (int hours)
```

Sets the[TtsSpan.ARG_HOURS](https://developer.android.com/reference/android/text/style/TtsSpan#ARG_HOURS)argument.

<br />

|                      Parameters                       ||
|---------|----------------------------------------------|
| `hours` | `int`: The value to be set for hours. <br /> |

|                                                                             Returns                                                                              ||
|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
| [TtsSpan.DurationBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder) | This instance. This value cannot be`null`. <br /> |

### setMinutes

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

```
public TtsSpan.DurationBuilder setMinutes (int minutes)
```

Sets the[TtsSpan.ARG_MINUTES](https://developer.android.com/reference/android/text/style/TtsSpan#ARG_MINUTES)argument.

<br />

|                        Parameters                         ||
|-----------|------------------------------------------------|
| `minutes` | `int`: The value to be set for minutes. <br /> |

|                                                                             Returns                                                                              ||
|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
| [TtsSpan.DurationBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder) | This instance. This value cannot be`null`. <br /> |

### setSeconds

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

```
public TtsSpan.DurationBuilder setSeconds (int seconds)
```

Sets the[TtsSpan.ARG_SECONDS](https://developer.android.com/reference/android/text/style/TtsSpan#ARG_SECONDS)argument.

<br />

|                        Parameters                         ||
|-----------|------------------------------------------------|
| `seconds` | `int`: The value to be set for seconds. <br /> |

|                                                                             Returns                                                                              ||
|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
| [TtsSpan.DurationBuilder](https://developer.android.com/reference/android/text/style/TtsSpan.DurationBuilder) | This instance. This value cannot be`null`. <br /> |