Skip to content

Voice Preview Generation #483

@lbedner

Description

@lbedner

Scope

Generate sample audio for voice preview functionality.

Tasks

1. Add preview endpoint

POST /ai/voice/preview
Body: {"voice": "nova", "text": "Hello, I'm Nova."}
Response: audio/mpeg

2. Pre-generate samples for each voice

  • Standard intro: "Hello, I'm {voice_name}. How can I help you today?"
  • Options:
    • Cache as static files (pre-generated)
    • Generate on-demand (first request)
    • Hybrid: pre-generate common voices, on-demand for others

3. Frontend integration

  • Play preview when user clicks voice card
  • Show loading indicator during generation
  • Handle playback errors gracefully

Files

  • app/components/backend/api/ai/router.py (add endpoint)
  • frontend/dashboard/components/VoicePreview.tsx

Dependencies

Verification

curl -X POST http://localhost:8000/ai/voice/preview \
  -H "Content-Type: application/json" \
  -d '{"voice": "nova", "text": "Hello!"}' \
  --output preview.mp3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions