Skip to content
MuszicPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

VāNī — Universal Translator

A beautiful, AI-powered translation application supporting 35+ Indian and worldwide languages. Translate text, audio files, live recordings, and entire documents with ease.

Features

🔤 Text Translation

Type or paste text and get instant translations with pronunciation guides.

🎵 Audio File Translation

Upload MP3, WAV, OGG, M4A, or WEBM files to transcribe and translate.

🎙️ Live Recording

Record your voice directly using the Web Speech API for real-time transcription and translation.

📄 Document Translation (NEW!)

Upload and translate entire documents while preserving formatting:

  • PDF — Extract and translate text content
  • Word (.docx) — Preserves paragraphs, tables, and basic formatting
  • PowerPoint (.pptx) — Translates slides, shapes, and table content
  • Excel (.xlsx) — Translates text in cells across all sheets
  • Text (.txt) — Simple text file translation
  • Batch Processing — Upload multiple files and download as ZIP

🔊 Text-to-Speech

Listen to translations in the target language.

🌐 35+ Languages Supported

Indian Languages

Hindi, Bengali, Telugu, Marathi, Tamil, Gujarati, Kannada, Malayalam, Punjabi, Odia, Assamese, Urdu, Sanskrit, Nepali, Sindhi

Worldwide Languages

English, Spanish, French, German, Italian, Portuguese, Russian, Japanese, Korean, Chinese (Simplified & Traditional), Arabic, Turkish, Vietnamese, Thai, Indonesian, Malay, Dutch, Polish, Swedish, Greek, Hebrew, Persian

Installation

Prerequisites

  • Python 3.8 or higher
  • FFmpeg (required for audio processing)
  • FLAC (required for speech recognition)

Install FFmpeg & FLAC

macOS:

brew install ffmpeg flac

Ubuntu/Debian:

sudo apt update
sudo apt install ffmpeg flac

Windows: Download from ffmpeg.org and add to PATH.

Setup

  1. Clone or navigate to the project directory:
cd speech-to-text
  1. Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python app.py
  1. Open your browser: Navigate to http://localhost:5000

Usage

Text Translation

  1. Select source language (or use Auto Detect)
  2. Select target language
  3. Type or paste your text
  4. Click "Translate" or press Ctrl/Cmd + Enter

Audio File Translation

  1. Click on "Audio File" tab
  2. Drag & drop or click to upload an audio file
  3. Select source and target languages
  4. Click "Translate Audio"

Live Recording

  1. Click on "Live Recording" tab
  2. Click the microphone button to start recording
  3. Speak your message (you'll see real-time transcription)
  4. Click the microphone again to stop
  5. The translation appears automatically

Document Translation

  1. Click on "Documents" tab
  2. Drag & drop files or click to browse
  3. Select multiple files for batch processing
  4. Choose source and target languages
  5. Click "Translate Documents"
  6. Download individual files or all as ZIP

API Endpoints

Endpoint Method Description
/api/languages GET Get list of supported languages
/api/translate/text POST Translate text
/api/translate/audio POST Translate audio file
/api/speech-to-text POST Convert speech to text
/api/text-to-speech POST Convert text to speech
/api/detect-language POST Detect text language
/api/document/translate POST Translate single document
/api/document/translate-batch POST Translate multiple documents
/api/document/download/<id> GET Download translated document
/api/document/preview POST Preview document content

Tech Stack

  • Backend: Flask, Google Translate API, Google Speech Recognition, gTTS
  • Frontend: Vanilla JavaScript, Modern CSS with animations
  • Audio Processing: Pydub, SpeechRecognition
  • Document Processing: python-docx, PyPDF2, python-pptx, openpyxl, reportlab

Project Structure

speech-to-text/
├── app.py                 # Flask application
├── document_processor.py  # Document processing module
├── requirements.txt       # Python dependencies
├── README.md             # This file
├── templates/
│   └── index.html        # Main HTML template
├── static/
│   ├── css/
│   │   └── style.css     # Styles
│   └── js/
│       └── app.js        # Frontend JavaScript
└── uploads/              # Temporary file storage (auto-created)

Troubleshooting

"Could not understand audio"

  • Ensure clear audio with minimal background noise
  • Speak clearly and at a moderate pace
  • Check that the correct source language is selected

Audio conversion failed

  • Make sure FFmpeg is installed correctly
  • Verify the audio file format is supported

Speech recognition errors

  • Check your internet connection (Google Speech API requires internet)
  • Try shorter audio clips

Document translation issues

  • Ensure the file is not password-protected
  • Check that the file is not corrupted
  • Large documents may take longer to process

Live recording not working

  • Allow microphone access when prompted
  • Use Chrome or Edge for best Web Speech API support
  • Check that no other app is using the microphone

License

MIT License

Acknowledgments

  • Google Translate API for translation services
  • Google Speech Recognition for speech-to-text
  • gTTS for text-to-speech synthesis
  • python-docx, PyPDF2, python-pptx, openpyxl for document processing

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages