PlayHT integration guide

An introduction to using the LiveKit Agents framework with PlayHT TTS.

Overview

PlayHT provides realistic TTS voice generation. With LiveKit's PlayHT integration and the Agents framework, you can build AI voice applications with fluent and conversational voices.

Note

If you're looking to build an AI voice assistant with PlayHT, check out our Voice Agent Quickstart guide and use the PlayHT TTS module as demonstrated below.

Quick reference

The following sections provide a quick reference for integrating PlayHT TTS with LiveKit. For a complete reference of all available parameters, see the plugin reference.

TTS

LiveKit's PlayHT integration provides a text-to-speech (TTS) interface. This can be used in a VoicePipelineAgent or as a standalone speech generator.

Usage

Use the playai.tts.TTS class to create an instance of a PlayHT TTS:

from livekit.plugins.playai import tts
playht_tts = tts.TTS(
voice="s3://voice-cloning-zero-shot/a59cb96d-bba8-4e24-81f2-e60b888a0275/charlottenarrativesaad/manifest.json",
language="SPANISH",
)

Parameters

This section describes some of the available parameters. For a complete reference of all available parameters, see the plugin reference.

api_keystringRequiredEnv: PLAYHT_API_KEY

PlayAI API key. Generate a user ID and API key in the PlayHT dashboard.

user_idstringRequiredEnv: PLAYHT_USER_ID

PlayAI user ID. Generate a user ID and API key in the PlayHT dashboard.

voicestringRequiredDefault: s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json

URL of the voice manifest file. For a full list, see List of pre-built voices.

modelTTSModel | stringRequiredDefault: Play3.0-mini

Name of the TTS model. For a full list, see Models.

languagestringRequiredDefault: ENGLISH

Language of the text to be spoken. For language support by model, see Models.