Commit Graph

15 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
1c495079eb First Push 2025-12-09 11:17:24 +00:00
a8802fd765 Implement Ollama integration service for AI-based speaker detection
- Created OllamaService class with httpx for API communication
- Implemented detect_speakers() method with structured prompts
- Added JSON response parser supporting multiple formats
- Implemented is_available() health check method
- Added 30-second timeout handling
- Configured OLLAMA_BASE_URL environment variable
- Added comprehensive unit tests with 100% coverage
- Updated requirements.txt with httpx dependency

Requirements: 14.1, 14.2, 14.3, 14.6
2025-12-09 10:35:30 +00:00
20e6cd1f9d feat: Add Ollama integration for AI-based speaker detection
- Added Requirement 14 for intelligent speaker detection using Ollama/llama3:8B
- Updated design document with OllamaService component and integration details
- Added 4 new correctness properties for Ollama functionality
- Added tasks 15-17 for implementing Ollama integration
- Updated technology stack to include httpx and Ollama
- Added error handling guidelines for Ollama integration
- Configured fallback to pattern-based detection when Ollama unavailable

This enhancement allows users to paste raw dialogue text without manual role markers.
The system will use AI to intelligently detect speakers, making the tool more user-friendly.
2025-12-09 10:31:38 +00:00
ff2c8f8404 docs: Create comprehensive README documentation
- Updated main README with detailed setup, Kokoro model configuration, and troubleshooting
- Enhanced backend README with API documentation, Docker setup, and testing instructions
- Improved frontend README with component details, deployment guide, and development tips
- Added workflow testing steps and common error solutions
- Documented all supported languages, voices, and configuration options

Implements task 14 from text-to-audiobook spec
Requirements: 13.1, 13.2, 13.3, 13.4, 13.5
2025-12-09 10:11:15 +00:00
50b0ef792a feat: Add responsive styling and mobile support
- Applied Tailwind CSS responsive classes across all components
- Implemented mobile-first design approach with breakpoints (sm, md, lg)
- Added touch-friendly interactions with min-h-[44px] touch targets
- Enhanced App.tsx with responsive padding, headings, and alerts
- Updated TextInputSection with responsive textarea and full-width mobile button
- Improved VoiceAssignmentSection with flexible layouts and mobile-optimized controls
- Enhanced AudioPlayerSection with responsive sizing and touch support
- Added custom CSS for range slider with larger thumb for mobile
- Improved select dropdowns with visible arrows and proper padding
- Added touch-manipulation class to prevent double-tap zoom
- Added active states for better mobile feedback
- Updated index.html with proper title and meta description
- Created RESPONSIVE_IMPROVEMENTS.md documentation

Requirements: 12.1, 12.2, 12.3, 12.4
2025-12-09 09:34:23 +00:00
ea77b17363 Implement audio player component with HTML5 audio and download functionality 2025-12-09 09:29:05 +00:00
e92d0349bf Implement voice assignment component (Task 10)
- Created VoiceAssignmentSection component with role-to-voice mapping
- Added language selector with American English, British English, French, Japanese
- Added speed slider (0.5x - 1.5x range)
- Implemented Generate Audiobook button with proper disabled state
- Integrated component into App.tsx with state management
- Added role detection API call on text submission
- Validates all roles have assigned voices before enabling generation

Requirements: 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 4.1, 4.2, 4.3, 4.4, 5.1, 5.2, 5.3
2025-12-09 07:48:19 +00:00
50d657f501 feat: implement API client module for frontend
- Create TypeScript interfaces (Role, RoleWithVoice, RolesResponse, GenerateRequest)
- Implement detectRoles() function for role detection
- Implement generateAudiobook() function for audio generation
- Implement checkHealth() function for backend health checks
- Add comprehensive error handling for network failures
- Use VITE_API_BASE_URL environment variable for configuration
- Add ApiError class for structured error handling

Requirements: 9.6, 9.7
2025-12-09 01:31:01 +00:00
1f759c36dc Complete task 7: Set up React frontend project structure
- Vite project with React and TypeScript initialized
- TypeScript configured with strict mode enabled
- Tailwind CSS set up for styling
- Component and API directory structure created
- Environment variables configured (.env with VITE_API_BASE_URL)
- Build and dev server verified working

Requirements: 9.6, 12.3
2025-12-09 01:26:25 +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
4f7c4c915d Update tasks.md: Mark task 4 as completed 2025-12-09 01:07: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