API Reference
Log In
API Reference

Generate realistic audio files from written text

Function: tts

Prototype:

async function tts(text: string, options?: TTSOptions): Promise<AudioTTS>

type TTSOptions = { voice?: string }; // See below the list of all possible voices

function AudioTTS.getMp3Buffer(): Buffer // Get the speech as an Mp3 file buffer
async function AudioTTS.getAudioBuffer(): Promise<AudioBuffer> // Get the speech as a standard [AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)
async function AudioTTS.play(): Promise<void> // Play the speech audio

💡 Example

// In React:
const { models: { tts } } = usePolyfire();
// In other environments:
const { models: { tts } } = polyfire;

const audio = await tts("According to all known laws of aviations, there is no way that a bee should be able to fly.");

await audio.play();

Available voices list:

namegenderdescriptionprovider
rachelfemalecalmelevenlabs
clydemalewar veteranelevenlabs
domifemalestrongelevenlabs
davemaleconversationalelevenlabs
finmalesailorelevenlabs
bellafemalesoftelevenlabs
antonimalewell-roundedelevenlabs
thomasmalecalmelevenlabs
charliemalecasualelevenlabs
emilyfemalecalmelevenlabs
ellifemaleemotionalelevenlabs
callummalehoarseelevenlabs
patrickmaleshoutyelevenlabs
harrymaleanxiouselevenlabs
liammaleelevenlabs
dorothyfemalepleasantelevenlabs
joshmaledeepelevenlabs
arnoldmalecrispelevenlabs
charlottefemaleseductiveelevenlabs
matildafemalewarmelevenlabs
matthewmaleelevenlabs
jamesmalecalmelevenlabs
josephmaleelevenlabs
jeremymaleexcitedelevenlabs
michaelmaleelevenlabs
ethanmaleelevenlabs
gigifemalechildlishelevenlabs
freyafemaleelevenlabs
gracefemaleelevenlabs
danielmaledeepelevenlabs
serenafemalepleasantelevenlabs
adammaledeepelevenlabs
nicolefemalewhisperelevenlabs
jessiemaleraspyelevenlabs
ryanmalesoldierelevenlabs
sammaleraspyelevenlabs
glindafemalewitchelevenlabs
giovannimaleforeignerelevenlabs
mimifemalechildishelevenlabs