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
This commit is contained in:
2025-12-09 01:21:39 +00:00
parent 4f7c4c915d
commit 271a127167
5 changed files with 343 additions and 4 deletions

View File

@@ -89,7 +89,7 @@
- Test synthesis with different voice IDs
- _Requirements: 6.4, 10.5, 10.6_
- [ ] 5. Implement audio generation endpoint
- [x] 5. Implement audio generation endpoint
- Create /api/tts POST endpoint
- Validate request fields (text, lang, roles, speed)
- Integrate TTSService to generate audio