# Text to Audiobook Backend FastAPI backend service for converting text to multi-voice audiobooks using Kokoro TTS. ## Setup ### Prerequisites - Python 3.10 or higher - espeak-ng (system dependency) ### Install espeak-ng **macOS:** ```bash brew install espeak-ng ``` **Linux (Ubuntu/Debian):** ```bash sudo apt-get update sudo apt-get install espeak-ng ``` ### Python Environment Setup 1. Create a virtual environment: ```bash python -m venv venv ``` 2. Activate the virtual environment: ```bash # macOS/Linux source venv/bin/activate # Windows venv\Scripts\activate ``` 3. Install dependencies: ```bash pip install -r requirements.txt ``` 4. Create environment file: ```bash cp .env.example .env ``` ## Running the Server ```bash uvicorn main:app --reload --host 0.0.0.0 --port 8000 ``` The API will be available at `http://localhost:8000` API documentation: `http://localhost:8000/docs` ## API Endpoints - `GET /api/health` - Health check endpoint - `POST /api/tts/roles` - Detect roles in text - `POST /api/tts` - Generate audiobook