Skip to main content

AI Voiceover Generator

Generate professional voice overs from text using OpenAI TTS with multiple voice options.

CLI Quickstart

praisonai recipe run ai-voiceover-generator \
  --input '{"text": "Welcome to our AI news show...", "voice": "alloy"}' \
  --json

Use in Your App (SDK)

import sys
sys.path.insert(0, 'agent_recipes/templates/ai-voiceover-generator')
from tools import generate_voiceover, generate_speech

# Generate voiceover
result = generate_voiceover(
    text="Welcome to our AI news show...",
    output_path="voiceover.mp3",
    voice="alloy",
    speed=1.0
)

# Generate speech from longer script (auto-chunks)
speech = generate_speech(
    script="Long script text here...",
    output_dir="./voiceovers",
    voice="nova"
)

Input Schema

{
  "type": "object",
  "properties": {
    "text": {"type": "string"},
    "voice": {
      "type": "string",
      "enum": ["alloy", "echo", "fable", "onyx", "nova", "shimmer"]
    },
    "speed": {"type": "number", "default": 1.0},
    "model": {
      "type": "string",
      "enum": ["tts-1", "tts-1-hd"]
    }
  }
}

Output Schema

{
  "path": "/output/voiceover.mp3",
  "voice": "alloy",
  "text_length": 500,
  "size_bytes": 45000
}

Available Voices

VoiceDescription
alloyNeutral, versatile
echoWarm, conversational
fableExpressive, narrative
onyxDeep, authoritative
novaFriendly, upbeat
shimmerClear, professional

Environment Variables

VariableRequiredDescription
OPENAI_API_KEYYesFor TTS API