A modern Text-to-Speech application built with FastAPI backend and Next.js frontend, utilizing Microsoft Edge TTS.
- Text-to-Speech conversion using Microsoft Edge TTS
- Multiple English voice options
- Adjustable speech rate
- Modern, minimal Material Design UI
- Real-time audio generation and playback
- Python 3.8+ (for backend)
- Node.js 18+ (for frontend)
- npm or yarn (for frontend package management)
- Navigate to the project root:
cd e:\python\tts-fast-next- Create and activate a virtual environment (if not already done):
python -m venv venv
.\venv\Scripts\activate- Install Python dependencies:
pip install -r backend\requirements.txt- Navigate to the frontend directory:
cd frontend- Install Node.js dependencies:
npm installRun both frontend and backend with a single command:
npm run devThis will start:
- ✅ Backend (FastAPI) →
http://localhost:8000 - ✅ Frontend (Next.js) →
http://localhost:3000
Open your browser to http://localhost:3000 and start using the app!
If you prefer to run the services individually:
npm run dev:backendStarts FastAPI server on port 8000
npm run dev:frontendStarts Next.js app on port 3000
Backend:
uvicorn backend.main:app --reload --port 8000Frontend:
cd frontend
npm run devGET /api/voices- Get list of available English voicesPOST /api/tts- Convert text to speech- Parameters:
text: Text to convert (required)voice: Voice ID (default: "en-US-JennyNeural")rate: Speech rate (default: "+0%")
- Parameters:
tts-fast-next/
├── backend/
│ ├── main.py # FastAPI application
│ ├── requirements.txt # Python dependencies
│ └── voices.json # Voice configuration
├── frontend/
│ ├── src/
│ │ └── app/
│ │ ├── page.tsx # Main application page
│ │ └── globals.css # Global styles
│ ├── package.json # Node.js dependencies
│ └── ...
├── venv/ # Python virtual environment
├── package.json # Root package.json for concurrent scripts
└── README.md # This file
The backend uses FastAPI with hot-reload enabled. Any changes to backend/main.py will automatically restart the server.
The frontend uses Next.js with Turbopack for fast development. Changes will be reflected immediately with hot module replacement.
- FastAPI
- edge-tts
- uvicorn
- python-multipart
- Next.js 15.4.4
- React 19.1.0
- TypeScript
- Tailwind CSS
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
- Ensure virtual environment is activated
- Check if port 8000 is already in use
- Verify all dependencies are installed:
pip install -r backend\requirements.txt
- Ensure Node.js dependencies are installed:
npm installin frontend directory - Check if port 3000 is already in use
- Clear Next.js cache:
rm -rf frontend/.next
- Ensure backend is running on port 8000
- Frontend must be on port 3000 for CORS to work properly