- 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
109 lines
2.6 KiB
Markdown
109 lines
2.6 KiB
Markdown
# Text to Audiobook
|
|
|
|
A full-stack application that converts long-form text into multi-voice audiobooks using Kokoro TTS (hexgrad/Kokoro-82M). The system automatically detects distinct roles/speakers in text, allows voice assignment per role, and generates high-quality audio.
|
|
|
|
## Features
|
|
|
|
- 🎭 Automatic role/speaker detection from text
|
|
- 🎤 Multi-voice synthesis with Kokoro TTS
|
|
- 🌍 Support for multiple languages (English, French, Japanese)
|
|
- ⚡ Fast local processing (no cloud dependencies)
|
|
- 📱 Responsive web interface
|
|
- 🎵 Audio playback and download
|
|
|
|
## Architecture
|
|
|
|
- **Frontend**: React + TypeScript + Vite + Tailwind CSS
|
|
- **Backend**: Python + FastAPI + Kokoro TTS
|
|
- **Deployment**: Docker containerization
|
|
|
|
## Quick Start
|
|
|
|
### Prerequisites
|
|
|
|
- Python 3.10+
|
|
- Node.js 20.19+ or 22.12+
|
|
- espeak-ng (system dependency)
|
|
|
|
### Backend Setup
|
|
|
|
1. Install espeak-ng:
|
|
```bash
|
|
# macOS
|
|
brew install espeak-ng
|
|
|
|
# Linux (Ubuntu/Debian)
|
|
sudo apt-get install espeak-ng
|
|
```
|
|
|
|
2. Set up Python environment:
|
|
```bash
|
|
cd backend
|
|
python -m venv venv
|
|
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
3. Run the backend:
|
|
```bash
|
|
uvicorn main:app --reload --host 0.0.0.0 --port 8000
|
|
```
|
|
|
|
### Frontend Setup
|
|
|
|
1. Install dependencies:
|
|
```bash
|
|
cd frontend
|
|
npm install
|
|
```
|
|
|
|
2. Configure environment:
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
3. Run the frontend:
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
4. Open http://localhost:5173 in your browser
|
|
|
|
## Usage
|
|
|
|
1. **Enter Text**: Paste your text with role markers (e.g., "Alice:", "[Narrator]")
|
|
2. **Assign Voices**: Select a Kokoro voice for each detected role
|
|
3. **Configure**: Choose language and playback speed
|
|
4. **Generate**: Create your multi-voice audiobook
|
|
5. **Listen & Download**: Play or save the generated audio
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
.
|
|
├── backend/ # FastAPI backend
|
|
│ ├── main.py # API endpoints
|
|
│ ├── services/ # Business logic
|
|
│ ├── requirements.txt # Python dependencies
|
|
│ └── README.md
|
|
├── frontend/ # React frontend
|
|
│ ├── src/
|
|
│ │ ├── api/ # API client
|
|
│ │ ├── components/ # React components
|
|
│ │ └── App.tsx # Main app
|
|
│ ├── package.json
|
|
│ └── README.md
|
|
└── README.md # This file
|
|
```
|
|
|
|
## Documentation
|
|
|
|
- [Backend Documentation](./backend/README.md)
|
|
- [Frontend Documentation](./frontend/README.md)
|
|
- [Requirements](./.kiro/specs/text-to-audiobook/requirements.md)
|
|
- [Design Document](./.kiro/specs/text-to-audiobook/design.md)
|
|
|
|
## License
|
|
|
|
MIT
|