Skip to content

Badaueba/text-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Reader

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 uses gTTS to generate MP3 audio.
  • voicer-frontend/: Contains all the Vue + Vite code for the UI.

Table of Contents


Project Structure

  • backend: Implements a /speak POST endpoint that uses gTTS audio.
  • voicer-frontend/: Contains all the Vue + Vite code for the UI.

Prerequisites

  1. Python 3.9+ (or a version that supports gTTS).
  2. Node.js 14+ (or higher) and npm or yarn for the frontend.
  3. Optionally, a virtual environment for Python dependencies.

Installation

Backend (Flask)

  1. Navigate to the project backend folder (where app.py is located).
  2. (Optional) Create and activate a virtual environment:
    python -m venv venv
    source venv/bin/activate    # On Linux/macOS
    # or
    venv\Scripts\activate       # On Windows
    
    

Setup & Run

  1. Backend (Flask)

    cd backend
    # Install Python dependencies
    pip install -r requirements.txt
    
    # Run the Flask server
    python app.py
    
  2. Frontend (Vue)

    Go to the frontend folder:

    cd voicer-frontend
    npm install
    # or
    yarn install
  1. Running the App

Development

  1. Start the Flask backend (in one terminal):
python app.py
  1. Start the Vite dev server (in another terminal):
cd voicer-frontend
npm run dev
# or
yarn dev

Production Build

Build the frontend for production:

cd voicer-frontend
npm run build
# or
yarn build

Running with Docker

docker-compose up

Usage

  1. Open your browser to the appropriate URL:

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.

About

using gTTs and LLM to read and interpret texts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published