Audio & Text-to-Speech
Generate natural-sounding speech and audio with AI.
Available Models
Text-to-Speech
| Model | Quality | Speed | Best For |
|---|---|---|---|
| fal-ai/playht/tts/v3 | Premium | ~3s | Professional voiceovers |
| fal-ai/f5-tts | High | ~2s | Fast 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
| Parameter | Type | Description |
|---|---|---|
| text | string | The text to convert to speech |
| voice | string | Voice ID (alloy, echo, fable, etc.) |
| speed | number | Playback 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.