Generate Speech

Text to speech synthesis

Convert text to natural-sounding speech in Next.js using the Vercel AI SDK's generateSpeech function. Stream audio directly to the browser with support for multiple voices and providers, giving your AI app a voice interface without complex audio infrastructure.

  • Read-aloud features for accessibility in content apps
  • Voice responses in conversational AI assistants
  • Audio narration for AI-generated summaries or reports
  • Notification audio for AI workflow completion events

Tech stack

Vercel AI SDKNext.jsTypeScriptWeb Audio APIOpenAI TTS
npx shadcn@latest add https://shadcnagents.com/r/basics-generate-speech
Generate Speech

Convert text to natural-sounding audio with OpenAI TTS.

Idletts-1
tts-1·Alloy·18 words