Commit Graph

6 Commits

Author SHA1 Message Date
ffd079dbcb feat: Add Docker configuration for backend
- Create Dockerfile with Python 3.10 base image
- Install system dependencies (espeak-ng) for Kokoro TTS
- Install Python dependencies from requirements.txt
- Copy backend code and expose port 8000
- Configure Uvicorn server startup
- Add docker-compose.yml for easy orchestration
- Include health checks and environment variables
- Add .dockerignore to optimize build context

Implements task 6 - Requirements 11.1-11.6
2025-12-09 01:23:00 +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
e6f4e2ea32 Implement TTS service with Kokoro integration
- Created TTSService class with pipeline caching per language
- Implemented text segmentation to identify role markers (colon and bracket patterns)
- Implemented segment synthesis with voice assignment
- Implemented audio concatenation at 24 kHz sample rate
- Added fallback to default voice (af_bella) for unmapped roles
- Supports language codes: a, b, f, j
- Handles long text by chunking on sentence boundaries
- Added comprehensive unit tests (13 tests, all passing)

Requirements: 10.1, 10.3, 10.4, 6.2, 6.3, 6.4, 6.5, 6.6
2025-12-09 01:06:59 +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