- Sample up to 4 chunks of 5000 characters from different text positions
- Distribute samples evenly across beginning, middle, and end of text
- Deduplicate speakers across all samples for comprehensive detection
- Log individual sample results for debugging
- Handle short texts efficiently (single sample)
- Updated tests to verify multi-sample behavior
This ensures speakers introduced anywhere in long texts are detected,
not just those appearing in the first 2000 characters.
- 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
- 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
- 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
- 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