A text-to-speech application built with Python (Flask) for the backend and Vue (Vite) for the frontend. Users can enter text, select a language and speed, and hear the generated audio in real time.
app.py
: Implements a/speak
POST endpoint that usesgTTS
to generate MP3 audio.voicer-frontend/
: Contains all the Vue + Vite code for the UI.
backend
: Implements a/speak
POST endpoint that usesgTTS
audio.voicer-frontend/
: Contains all the Vue + Vite code for the UI.
- Python 3.9+ (or a version that supports
gTTS
). - Node.js 14+ (or higher) and npm or yarn for the frontend.
- Optionally, a virtual environment for Python dependencies.
- Navigate to the project backend folder (where
app.py
is located). - (Optional) Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Linux/macOS # or venv\Scripts\activate # On Windows
-
Backend (Flask)
cd backend # Install Python dependencies pip install -r requirements.txt # Run the Flask server python app.py
-
Frontend (Vue)
Go to the frontend folder:
cd voicer-frontend
npm install
# or
yarn install
- Running the App
- Start the Flask backend (in one terminal):
python app.py
- Start the Vite dev server (in another terminal):
cd voicer-frontend
npm run dev
# or
yarn dev
Build the frontend for production:
cd voicer-frontend
npm run build
# or
yarn build
docker-compose up
- Open your browser to the appropriate URL:
-
Development: http://localhost:5173 (with the dev server).
-
Production: http://localhost:5000 (if you’re serving the built files from Flask).
Enter your text in the Texto field.
Select Idioma (e.g., “Português (Brasil)”) and Velocidade (“Normal” "Rápida" or “Lenta”).
Click OUVIR. The app sends a POST request to the /speak endpoint, gets an MP3 blob, and plays it.
This project is licensed under the MIT License. Feel free to adapt it as needed.