Docs/Guides/Audio & TTS

Audio & Text-to-Speech

Generate natural-sounding speech and audio with AI.

Available Models

Text-to-Speech

ModelQualitySpeedBest For
fal-ai/playht/tts/v3Premium~3sProfessional voiceovers
fal-ai/f5-ttsHigh~2sFast generation

Basic Text-to-Speech

Convert text to natural-sounding speech:

const result = await abstrakt.run('fal-ai/playht/tts/v3', {
  text: 'Welcome to Abstrakt! The unified API for AI.',
  voice: 'alloy',
  speed: 1.0
});

console.log('Audio URL:', result.output.items[0].url);

Voice Options

Choose from various voice styles:

alloy

Neutral, balanced voice

echo

Warm, conversational

fable

Expressive, storytelling

onyx

Deep, authoritative

nova

Bright, energetic

shimmer

Soft, gentle

Parameters

ParameterTypeDescription
textstringThe text to convert to speech
voicestringVoice ID (alloy, echo, fable, etc.)
speednumberPlayback speed (0.5 to 2.0)

Long-form Content

For longer text, consider breaking it into chunks:

// Split long text into paragraphs
const paragraphs = longText.split('\n\n');

// Generate audio for each paragraph
const audioUrls = await Promise.all(
  paragraphs.map(text => 
    abstrakt.run('fal-ai/playht/tts/v3', {
      text,
      voice: 'alloy'
    })
  )
);

// Combine audio files on your server
const urls = audioUrls.map(r => r.output.items[0].url);

Common Use Cases

  • Podcasts & Audiobooks: Convert written content to audio format.
  • Video Narration: Generate voiceovers for videos and presentations.
  • Accessibility: Make content accessible with audio versions.
  • IVR Systems: Create dynamic voice prompts for phone systems.
  • Language Learning: Generate pronunciation examples.

Next Steps