Commit Graph

8 Commits

Author SHA1 Message Date
cea97d3cd4 Task 19: Update TTS generation endpoint to accept edited scripts
- Modified TTSRequest to accept optional segments array
- Updated generate_audiobook endpoint to use segments if provided
- Added generate_audiobook_from_segments method to TTSService
- Ensured backward compatibility with text-based generation
- Added comprehensive tests for segment-based generation
- All tests passing (7/7)

Requirements: 15.7
2025-12-09 11:46:10 +00:00
e2196c592a Implement script generation endpoint (Task 18)
- Added ScriptRequest, ScriptResponse, and ScriptSegment Pydantic models
- Created /api/tts/script POST endpoint in main.py
- Integrated with TTSService to generate script segments using AI
- Added generate_script_segments method to TTSService
- Returns segments with unique IDs for frontend tracking
- Handles errors gracefully when AI segmentation fails
- Falls back to pattern-based segmentation when Ollama unavailable
- Added comprehensive tests for the endpoint
- Validates: Requirements 15.1, 15.2
2025-12-09 11:43:04 +00:00
5c7b339bdf Add all 54 Kokoro TTS voices and 9 language support
- Expanded from 8 to 54 voices across 9 languages
- American English: 21 voices (11 female, 10 male)
- British English: 8 voices (4 female, 4 male)
- Spanish: 3 voices (1 female, 2 male)
- French: 1 voice (1 female)
- Hindi: 4 voices (2 female, 2 male)
- Italian: 2 voices (1 female, 1 male)
- Japanese: 5 voices (4 female, 1 male)
- Portuguese: 3 voices (1 female, 2 male)
- Chinese: 7 voices (4 female, 4 male)
- Updated backend to support all language codes (a,b,e,f,h,i,j,p,z)
- Added comprehensive voice documentation
2025-12-09 11:14:28 +00:00
f56f8086e5 Integrate Ollama into role detection with fallback to pattern matching
- Updated RoleDetector to use OllamaService for AI-based speaker detection
- Implemented _detect_with_ollama() method with availability check
- Added fallback logic: tries Ollama first, then pattern matching
- Implemented role merging and deduplication across both methods
- Handles Ollama unavailable gracefully with logging
- Logs detection method used (AI vs pattern)
- Updated main.py endpoint to await async detect_roles
- Added comprehensive integration tests

Requirements: 14.1, 14.4, 14.5
2025-12-09 10:49:37 +00:00
271a127167 Implement audio generation endpoint
- Add POST /api/tts endpoint with full request validation
- Validate text, language code, speed range, and roles list
- Integrate TTSService to generate multi-voice audiobooks
- Fix Kokoro pipeline generator handling to properly collect audio
- Stream audio response with correct Content-Type (audio/wav)
- Add Content-Disposition header with filename (audiobook.wav)
- Handle errors gracefully with appropriate HTTP status codes
- Add comprehensive test suite for endpoint validation

Requirements: 6.1, 6.7, 6.8, 9.5
2025-12-09 01:21:39 +00:00
77437348ed Implement role detection service with pattern matching
- Created RoleDetector class with colon and bracket pattern extraction
- Implemented role deduplication logic
- Added fallback to default 'Narrator' role when no patterns found
- Created /api/tts/roles endpoint using RoleDetector
- Added comprehensive test suite for role detection
- All tests passing (7/7)

Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
2025-12-09 01:04:09 +00:00
31da896e56 Implement backend API foundation
- Created FastAPI application with CORS middleware
- Defined Pydantic models (RoleDetectionRequest, RolesResponse, TTSRequest, ErrorResponse)
- Implemented /api/health endpoint
- Set up error handling middleware for validation and general exceptions
- Configured logging with INFO level
- Added test script to verify API functionality
- Validates Requirements: 9.1, 9.2, 9.4
2025-12-09 00:57:46 +00:00
f4bc759007 Task 1: Set up project structure and dependencies
- Created backend directory with FastAPI project structure
- Created frontend directory with React + TypeScript + Vite
- Configured Python virtual environment and installed dependencies (fastapi, uvicorn, kokoro, soundfile, python-multipart)
- Verified espeak-ng system dependency is installed
- Configured Node.js project with TypeScript, React, and Vite
- Set up Tailwind CSS for styling
- Set up environment variable configuration for both projects
- Created comprehensive README documentation

Requirements: 9.6, 10.2, 11.1
2025-12-09 00:47:44 +00:00