Skip to main content
The synthesize() method converts text to natural-sounding speech using on-device neural voice models.

Basic Usage

Setup

Before synthesizing, register the ONNX module and load a TTS voice:

Method Signatures

Basic Synthesis

Speak (with automatic playback)

TTSOutput

TTSOptions

Examples

Simple Text-to-Speech

With Custom Options

Speak (Automatic Playback)

Playing Audio Manually

SwiftUI Voice Output

Save to File

Voice Management

Synthesis Metadata

Error Handling

Best Practices

For long text, use streaming synthesis or split into sentences to reduce latency.
Load TTS voices at app startup to avoid delays when synthesizing.
Configure AVAudioSession appropriately for your app’s audio needs.

Streaming TTS

Stream audio for long text →

Voices

Available voices →