This commit adds the Auto-Dubbing feature for Podcast Maker with support for translating podcast audio to different languages with optional voice cloning to preserve the original speaker's voice. New Features: - Translation Service (common module): DeepL integration for low-cost translation, WaveSpeed integration for high-quality translation - Audio Dubbing Service: STT -> Translate -> TTS pipeline with voice cloning support - 9 new API endpoints for dubbing and voice cloning - Support for 34+ languages - Cost estimation utilities - Comprehensive documentation Files Added: - services/translation/ (5 files): Translation service module - services/dubbing/: Audio dubbing service - api/podcast/handlers/dubbing.py: API endpoints - docs/AUTO_DUBBING.md: Feature documentation - CHANGELOG.md: Change log Files Modified: - api/podcast/models.py: Added dubbing request/response models - api/podcast/router.py: Added dubbing routes - services/__init__.py: Export translation and dubbing services - scene_animation.py: Fixed missing Path import
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
"""
|
|
Podcast Maker API Router
|
|
|
|
Main router that imports and registers all handler modules.
|
|
"""
|
|
|
|
from fastapi import APIRouter, Depends
|
|
from typing import Dict, Any
|
|
|
|
from middleware.auth_middleware import get_current_user
|
|
from api.story_writer.utils.auth import require_authenticated_user
|
|
from api.story_writer.task_manager import task_manager
|
|
|
|
# Import all handler routers
|
|
from .handlers import projects, analysis, research, script, audio, images, video, avatar, dubbing
|
|
|
|
# Create main router
|
|
router = APIRouter(prefix="/api/podcast", tags=["Podcast Maker"])
|
|
|
|
# Include all handler routers
|
|
router.include_router(projects.router)
|
|
router.include_router(analysis.router)
|
|
router.include_router(research.router)
|
|
router.include_router(script.router)
|
|
router.include_router(audio.router)
|
|
router.include_router(images.router)
|
|
router.include_router(video.router)
|
|
router.include_router(avatar.router)
|
|
router.include_router(dubbing.router)
|
|
|
|
|
|
@router.get("/task/{task_id}/status")
|
|
async def podcast_task_status(task_id: str, current_user: Dict[str, Any] = Depends(get_current_user)):
|
|
"""Expose task status under podcast namespace (reuses shared task manager)."""
|
|
require_authenticated_user(current_user)
|
|
return task_manager.get_task_status(task_id)
|