A production-grade, full-stack AI speech recognition system that transcribes any audio in any language โ powered by a multi-stage AI pipeline combining vocal isolation, noise reduction, and transformer-based transcription.
๐ Try Live Demo ย ย ยทย ย โก Quick Start ย ย ยทย ย ๐ Architecture ย ย ยทย ย โจ Features
Most speech recognition tools fail in the real world because they assume clean, perfect audio. They struggle with:
- ๐ต Background music underneath speech (YouTube videos, podcasts, interviews)
- ๐ Non-English languages โ or mixed language audio
- ๐ Crowd noise and ambient sound degrading accuracy
- โฑ๏ธ Long audio files hitting API rate limits and time restrictions
VoiceScript solves all of this through a three-stage AI pipeline that processes audio before a single word is transcribed.
|
|
|
|
| Technology | Version | Purpose |
|---|---|---|
| Python | 3.10+ | Core backend language |
| Flask | 3.0.3 | REST API server + frontend serving |
| Flask-CORS | 4.0.1 | Cross-origin request handling |
| OpenAI Whisper | medium | Primary speech-to-text AI (769M params) |
| Facebook Demucs | 4.0.1 | Neural source separation โ vocal isolation |
| pydub | 0.25.1 | Audio format conversion + preprocessing |
| deep-translator | 1.11.4 | Google Translate integration (55+ languages) |
| SpeechRecognition | 3.11.0 | Fallback recognition engine |
| NumPy | 2.4.4 | Numerical processing for Whisper |
| ffmpeg | 8.1 | Low-level audio codec processing |
| Technology | Purpose |
|---|---|
| HTML5 | Semantic structure |
| CSS3 | Dark theme, keyframe animations, responsive grid |
| Vanilla JavaScript ES6+ | MediaRecorder API, Fetch API, DOM manipulation |
| Web Audio API | Live microphone capture |
| Google Fonts | Space Grotesk + Inter typography |
| Technology | Purpose |
|---|---|
| Docker | Containerized deployment |
| Hugging Face Spaces | Production hosting (16GB RAM, free tier) |
| GitHub | Version control + CI |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FRONTEND โ
โ HTML5 ยท CSS3 ยท Vanilla JS ES6+ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ File Upload โ โ Live Mic Recording โ โ
โ โ Drag & Drop โ โ MediaRecorder API โ โ
โ โ MP3/WAV/FLAC/OGG โ โ webm/ogg format โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ โ
โ โ HTTP POST /transcribe โ
โ โ multipart/form-data + mode โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FLASK API โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโ โ
โ โ app.py โ โ
โ โ POST /transcribeโ โ
โ โ POST /translate โ โ
โ โ GET /languages โ โ
โ โ GET /health โ โ
โ โโโโโโโโโโฌโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ BEAST MODE PIPELINE โ โ
โ โ โ โ
โ โ STAGE 1 โ pydub โ โ
โ โ โโ Any format โ 16kHz mono WAV โ โ
โ โ โโ Volume normalization โ โ
โ โ โโ Silence stripping โ โ
โ โ โ โ โ
โ โ STAGE 2 โ Facebook Demucs โ โ
โ โ โโ htdemucs model โ โ
โ โ โโ Neural source separation โ โ
โ โ โโ Isolate vocal stem โ โ
โ โ โโ Discard music/noise/drums โ โ
โ โ โ โ โ
โ โ STAGE 3 โ OpenAI Whisper Medium โ โ
โ โ โโ 769M parameter transformer โ โ
โ โ โโ beam_size=5 best_of=5 โ โ
โ โ โโ temperature=0 patience=2 โ โ
โ โ โโ condition_on_previous_text=Trueโ โ
โ โ โโ no_speech_threshold=0.25 โ โ
โ โ โโ word_timestamps=True โ โ
โ โ โโ Auto language detection โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ JSON response: { transcript, segments, โ
โ detected_language, duration, โ
โ word_count, engine } โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FRONTEND RENDERS โ
โ ยท Transcript text โ
โ ยท Language badge โ
โ ยท Timestamps view โ
โ ยท Translation panel โ
โ ยท Export buttons โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
VoiceScript/
โ
โโโ backend/
โ โโโ app.py # Flask server โ all API routes
โ โโโ transcriber.py # Beast mode pipeline: pydub โ Demucs โ Whisper
โ โโโ translator.py # Google Translate integration (55+ languages)
โ
โโโ frontend/
โ โโโ index.html # App structure โ all UI elements
โ โโโ style.css # Dark theme, keyframe animations, responsive layout
โ โโโ app.js # MediaRecorder, Fetch API, all interactivity
โ
โโโ uploads/ # Temp audio storage (auto-deleted after processing)
โ โโโ .gitkeep
โ
โโโ docs/
โ โโโ Screenshot.png # UI screenshot
โ
โโโ Dockerfile # Docker container config for HF Spaces
โโโ .gitignore # Excludes venv, uploads, cache
โโโ requirements.txt # All Python dependencies
โโโ README.md # This file
- Python 3.10+
- Git
- ffmpeg โ
winget install ffmpegon Windows - Modern browser (Chrome, Edge, Firefox)
git clone https://github.com/TUSHARTAMRAKAR/VoiceScript.git
cd VoiceScriptpython -m venv venv
# Windows
venv\Scripts\activate
# Mac/Linux
source venv/bin/activatepip install -r requirements.txt
โ ๏ธ First run downloads:
- Whisper
mediummodel โ ~769MB (cached at~/.cache/whisper/)- Demucs
htdemucsmodel โ ~300MB (cached automatically)Both are one-time downloads. Every subsequent run loads instantly.
cd backend
python app.pyOpen http://localhost:7860 in your browser. VoiceScript is running.
Deployed on Hugging Face Spaces ยท Docker ยท CPU Basic ยท Always On
Upload a file:
- Drop any audio file onto the upload zone
- Choose mode โ
TranscribeorAny Language โ English - Click Transcribe File
- Get transcript + language badge + timestamps + export options
Record live:
- Click Start Recording โ allow mic access
- Speak clearly
- Click Stop & Transcribe
- Transcript appears in seconds
Translate:
- After transcription, the Translate panel appears
- Pick any of 55+ languages from the dropdown
- Click Translate โ Google Translate does the rest
Export:
- TXT โ plain text file with metadata header
- SRT โ subtitle file with timestamps, ready for YouTube/VLC
- PDF โ opens a clean print-ready page, save as PDF
Change Whisper model in backend/transcriber.py:
# tiny | base | small | medium | large-v3
# medium = best CPU balance (default)
# large-v3 = maximum accuracy (needs GPU for practical speed)
WHISPER_MODEL_SIZE = "medium"Change transcription language in backend/transcriber.py:
language = "en" # en, hi, de, fr, es, ja, ko, zh...
# Remove language= entirely for auto-detection- GPU acceleration (CUDA) for large-v3 model
- Real-time streaming transcription
- Speaker diarization (who said what)
- AI summarization of long transcripts
- Transcript history (localStorage)
- Docker compose for one-command setup
- REST API documentation (Swagger/OpenAPI)
- Chrome extension for transcribing browser audio
# Fork โ clone โ create branch
git checkout -b feature/your-feature
# Make changes, then
git commit -m "feat: describe your change"
git push origin feature/your-feature
# Open a Pull RequestPlease follow Conventional Commits.
Full-Stack Developer ยท AI/ML Enthusiast ยท Builder
"Built with curiosity, powered by caffeine, debugged at 2AM." โ
MIT License โ Copyright (c) 2026 Tushar Tamrakar
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software to deal in the Software without restriction,
including the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
