# AudioTextToSpeech

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Memory category: Internal
- HTML page: https://rapi.sleaze.dev/classes/AudioTextToSpeech/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/AudioTextToSpeech

Plays text as speech audio.

## Properties

### AutoLocalize

```luau
AudioTextToSpeech.AutoLocalize: boolean = true
```

- Tags: Capabilities: Audio

### IsLoaded

```luau
AudioTextToSpeech.IsLoaded: boolean = false
```

- Tags: Read only, Read capabilities: Audio, Save only

Denotes whether the [`AudioTextToSpeech`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md) object is loaded, buffered, and ready to play.

### Pitch

```luau
AudioTextToSpeech.Pitch: number = 0
```

- Tags: Read capabilities: Audio

Controls the pitch of the generated speech audio, which will be independent of its speed.

### Speed

```luau
AudioTextToSpeech.Speed: number = 1
```

- Tags: Read capabilities: Audio

Controls the speed of the generated speech audio, which will be independent of its pitch.

### Text

```luau
AudioTextToSpeech.Text: string = ""
```

- Tags: Read capabilities: Audio

The text to be converted into speech audio by [`AudioTextToSpeech`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md).

### TimeLength

```luau
AudioTextToSpeech.TimeLength: number = 0
```

- Tags: Read only, Read capabilities: Audio, Save only

Denotes the length of the generated speech audio.

### VoiceId

```luau
AudioTextToSpeech.VoiceId: string = ""
```

- Tags: Read capabilities: Audio

The voice style to be used by [`AudioTextToSpeech`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md).

### IsPlaying

```luau
AudioTextToSpeech.IsPlaying: boolean = false
```

- Tags: Write: Roblox engine security, Read capabilities: Audio

Denotes whether the [`AudioTextToSpeech`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md) object is currently playing.

### Looping

```luau
AudioTextToSpeech.Looping: boolean = false
```

- Tags: Read capabilities: Audio

Controls whether the [`AudioTextToSpeech`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md) object loops.

### PlaybackSpeed

```luau
AudioTextToSpeech.PlaybackSpeed: number = 1
```

- Tags: Read capabilities: Audio

Controls how quickly the speech audio will be played, which controls its pitch.

### TimePosition

```luau
AudioTextToSpeech.TimePosition: number = 0
```

- Tags: Read capabilities: Audio

Tracks the current position of the playhead within the generated speech audio.

### Volume

```luau
AudioTextToSpeech.Volume: number = 1
```

- Tags: Read capabilities: Audio

Controls how loudly the generated speech audio will be played.

## Methods

### GetConnectedWires

```luau
AudioTextToSpeech:GetConnectedWires(pin: string): { Instance }
```

- Tags: Capabilities: Audio

Returns an array of `Wires` that are connected to the specified pin.

Parameters:

- `pin`: An input or output pin on this instance

Returns: An array of `Wires`

### GetInputPins

```luau
AudioTextToSpeech:GetInputPins(): { any }
```

- Tags: Capabilities: Audio

Gets the list of pins that a [`Wire`](https://rapi.sleaze.dev/classes/Wire.md) can use in [`Wire.TargetName`](https://rapi.sleaze.dev/classes/Wire.md) to connect to this instance via its [`Wire.TargetInstance`](https://rapi.sleaze.dev/classes/Wire.md) property.

Returns: An array of strings representing valid pin names.

### GetOutputPins

```luau
AudioTextToSpeech:GetOutputPins(): { any }
```

- Tags: Capabilities: Audio

Gets the list of pins that a [`Wire`](https://rapi.sleaze.dev/classes/Wire.md) can use in [`Wire.SourceName`](https://rapi.sleaze.dev/classes/Wire.md) to connect to this instance via its [`Wire.SourceInstance`](https://rapi.sleaze.dev/classes/Wire.md) property.

Returns: An array of strings representing valid pin names.

### GetWaveformAsync

```luau
AudioTextToSpeech:GetWaveformAsync(timeRange: NumberRange, samples: number): { any }
```

- Tags: Yields, Capabilities: Audio

Returns a sampling of the waveform data for the generated audio.

Parameters:

- `timeRange`: The start and end time (in seconds) of the segment to read.
- `samples`: The number of samples to return for the specified range.

Returns: A table of `samples` numbers ranging between -1 and 1 representing the sampled waveform,

### LoadAsync

```luau
AudioTextToSpeech:LoadAsync(): Enum.AssetFetchStatus
```

- Tags: Yields, Capabilities: Audio

Generates speech audio.

Returns: An `AssetFetchStatus` — `Success` once the speech audio has been generated, or `Failure` if generation could not be completed.

### LoadPlatformAsync

```luau
AudioTextToSpeech:LoadPlatformAsync(): Enum.AssetFetchStatus
```

- Tags: Yields, Roblox script security, Capabilities: Audio

### Pause

```luau
AudioTextToSpeech:Pause()
```

- Tags: Capabilities: Audio

Pauses the [`AudioTextToSpeech`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md) object wherever its [`TimePosition`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md) is.

### Play

```luau
AudioTextToSpeech:Play()
```

- Tags: Capabilities: Audio

Plays the [`AudioTextToSpeech`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md) from wherever its [`TimePosition`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md) is.

### Unload

```luau
AudioTextToSpeech:Unload()
```

- Tags: Capabilities: Audio

Unload the generated speech audio.

## Events

### Ended

```luau
AudioTextToSpeech.Ended: RBXScriptSignal<()>
```

- Tags: Capabilities: Audio

Fires when the [`AudioTextToSpeech`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md) object has completed playback and paused.

### Looped

```luau
AudioTextToSpeech.Looped: RBXScriptSignal<()>
```

- Tags: Capabilities: Audio

Fires when the [`AudioTextToSpeech`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md) object loops.

### WiringChanged

```luau
AudioTextToSpeech.WiringChanged: RBXScriptSignal<(connected: boolean, pin: string, wire: Wire, instance: Instance)>
```

- Tags: Capabilities: Audio

Fires when another instance is connected to or disconnected from the [`AudioTextToSpeech`](https://rapi.sleaze.dev/classes/AudioTextToSpeech.md) via a [`Wire`](https://rapi.sleaze.dev/classes/Wire.md).

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
