A Python-based voice assistant server using Flask. It provides Speech-to-Text (STT) capabilities using faster_whisper and Text-to-Speech (TTS) using edge_tts.
- Speech-to-Text (STT): Transcribes audio files uploaded to the
/transcribeendpoint. - Text-to-Speech (TTS): Converts text to speech and returns an audio file via the
/speakendpoint. - REST API: Simple Flask-based API for integration with frontend applications.
- Python 3.8+
- FFmpeg (Required for audio processing)
-
Clone the repository:
git clone <your-repo-url> cd VoiceAssistant
-
Create and activate a virtual environment:
python -m venv venv # Windows venv\Scripts\activate # Linux/Mac source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Start the server:
python app.py
The server will start at
http://127.0.0.1:5000. -
Open
voice-assistant-v4.html(orv3) in your browser to interact with the assistant.
- Description: specific audio file for transcription.
- Form Data:
audio(File) - Response: JSON
{ "transcript": "..." }
- Description: specific text for speech generation.
- JSON Body:
{ "text": "Hello world" } - Response: Audio file (MP3) or JSON error.
- To avoid NVIDIA driver errors, the model is configured to run on CPU by default.