<br />

Options to configure the MediaPipe TextToSpeech Task on the Web.

**Signature:**

```typescript
export declare interface TextToSpeechOptions extends TaskRunnerOptions 
```

## Properties

| Property | Modifiers | Type | Description |
|---|---|---|---|
| [defaultVoiceId](https://developers.google.com/edge/api/mediapipe/js/tasks-audio.texttospeechoptions.md.txt#texttospeechoptionsdefaultvoiceid) |   | string | Optional default voice ID (e.g. "af_heart"). When unset, the engine's default voice is used. |
| [defaultLocale](https://developers.google.com/edge/api/mediapipe/js/tasks-audio.texttospeechoptions.md.txt#texttospeechoptionsdefaultlocale) |   | string | Optional default BCP-47 locale (e.g. "en-US"). When unset, inferred from the selected voice metadata. |
| [speakingRate](https://developers.google.com/edge/api/mediapipe/js/tasks-audio.texttospeechoptions.md.txt#texttospeechoptionsspeakingrate) |   | number | Speaking rate multiplier in `(0.0, 4.0]`. Defaults to `1.0` (normal speed). |
| [targetBucket](https://developers.google.com/edge/api/mediapipe/js/tasks-audio.texttospeechoptions.md.txt#texttospeechoptionstargetbucket) |   | number | Target sequence length bucket for static-shape Kokoro models (`0` = auto). |
| [modelAssetSize](https://developers.google.com/edge/api/mediapipe/js/tasks-audio.texttospeechoptions.md.txt#texttospeechoptionsmodelassetsize) |   | number | **Deprecated.** Optional byte length of `baseOptions.modelAssetBuffer` when provided as a `ReadableStreamDefaultReader`. |

## TextToSpeechOptions.defaultVoiceId

Optional default voice ID (e.g. "af_heart"). When unset, the engine's default voice is used.

**Signature:**

```typescript
defaultVoiceId?: string;
```

## TextToSpeechOptions.defaultLocale

Optional default BCP-47 locale (e.g. "en-US"). When unset, inferred from the selected voice metadata.

**Signature:**

```typescript
defaultLocale?: string;
```

## TextToSpeechOptions.speakingRate

Speaking rate multiplier in `(0.0, 4.0]`. Defaults to `1.0` (normal speed).

**Signature:**

```typescript
speakingRate?: number;
```

## TextToSpeechOptions.targetBucket

Target sequence length bucket for static-shape Kokoro models (`0` = auto).

**Signature:**

```typescript
targetBucket?: number;
```

## TextToSpeechOptions.modelAssetSize

Optional byte length of `baseOptions.modelAssetBuffer` when provided as a `ReadableStreamDefaultReader`.

> [!WARNING]
> **Warning:** **Deprecated.** Unused: the model is always written to the Wasm virtual filesystem, which the native TextToSpeech requires.

**Signature:**

```typescript
modelAssetSize?: number;
```