Skip to main content

Overview

The Text-to-Speech (TTS) API converts text to spoken audio using on-device neural voice synthesis with Piper TTS. All synthesis happens locally on the device.

Basic Usage

Setup

Before synthesizing, download and load a TTS model:

API Reference

synthesize

Convert text to audio data.
Parameters:

Configuration

Result

Examples

Basic Synthesis

With Voice Options

Play Audio

TTSPlayer.tsx

Using System TTS

For simpler playback using platform’s built-in TTS:

Get Available Voices

Converting Audio for Playback

The synthesized audio is base64-encoded float32 PCM. Use the SDK’s Audio utility to convert and play:
AudioContext / Web Audio API does not work in React Native. Always use RunAnywhere.Audio.createWavFromPCMFloat32() to convert TTS output before playback.

Voice Options Explained

Error Handling

TTS Streaming

Streaming synthesis

TTS Voices

Available voices

Voice Agent

Full voice pipeline