| title | VoiceNote AI Transliteration |
|---|---|
| emoji | 🎙️ |
| colorFrom | purple |
| colorTo | indigo |
| sdk | gradio |
| sdk_version | 4.44.1 |
| python_version | 3.10 |
| app_file | app/main.py |
| pinned | false |
Tamil voice-note pipeline: Whisper ASR (Tamil transcript) plus custom Tamil-to-ASCII romanization, served through a Gradio web UI. This is script transliteration, not translation into another language.
There is no LLM in the current app path—only speech recognition and romanized output.
- Upload or record Tamil audio in the browser
- One-click Transcribe & Transliterate
- Built-in sample via Try with sample audio (
sample_inputs/sample.wav) - Long audio handled with chunking and a bounded in-memory queue
- Timestamped
.txtfiles underoutputs/transcriptsandoutputs/transliterations
flowchart LR
A[Audio upload / mic] --> B[Whisper medium]
B --> C[Tamil transcript]
C --> D[Tamil romanizer]
D --> E[ASCII romanization]
B --> F[outputs/transcripts]
D --> G[outputs/transliterations]
- ASR —
openai/whisper-mediumtranscribes audio withlanguage=ta. - Chunking — Files longer than ~30s are split with
pydub; chunks are processed in batches (queue size from config) and joined. - Transliteration —
app/tamil_romanizer.pymaps Tamil graphemes to Tamil-aware Latin (ASCII), e.g.நான் சாப்பிட்டேன்→naan saappittaen. - UI — Gradio shows both text fields; files are saved on each successful run.
| Requirement | Notes |
|---|---|
| Python | 3.10+ recommended; 3.13 works with pinned Gradio stack in requirements.txt |
| ffmpeg | Required by Whisper / pydub for many formats (install via OS package manager) |
| Disk / network | First run downloads the Whisper medium weights (~1.5 GB) |
GPU (optional): Set "device": "cuda" in models/model_config.py if PyTorch sees a CUDA device.
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python app/main.pyOpen: http://localhost:7860
The first transcription may take a while while the model loads and (on first use) downloads weights.
docker compose up --build- URL: http://localhost:7860
- Image: Python 3.10,
ffmpegandcurlincluded - Volumes:
./outputsand./sample_inputsmounted into the container - Healthcheck: HTTP probe on port 7860 (allow ~60s on first start for model load)
Stop with Ctrl+C or docker compose down.
The app reads host/port from environment variables (see Configuration), so the same code runs locally, in Docker, and on hosted platforms.
-
Create a Space → SDK: Gradio, then push this repo (or link it from GitHub).
-
Tell the Space to use this entry point by adding a YAML header at the top of the Space's own README (or in the Space settings):
--- title: VoiceNote AI Transliteration sdk: gradio app_file: app/main.py ---
-
packages.txt(containsffmpeg) installs the system dependency automatically. -
The free CPU tier is slow with
whisper-medium; setWHISPER_MODEL_ID=openai/whisper-smallin the Space's variables, or use a paid GPU Space.
- Point the service at this repo; both detect the
Dockerfile. - They inject
$PORT, whichmodel_config.pyalready honors — no code change needed. - Choose an instance with enough RAM (the
mediummodel needs ~2–4 GB).
git clone https://github.com/samadarsh/VoiceNote-AI.git
cd VoiceNote-AI
docker compose up --build -dPut Nginx/Caddy in front for HTTPS + a domain. Use a GPU instance and set
ASR_DEVICE=cuda for fast transcription.
Run with GRADIO_SHARE=true python app/main.py for a public URL that lasts ~72h
(good for a quick demo, not production).
Defaults live in models/model_config.py and can be overridden with environment
variables (see .env.example).
| Section | Key settings | Purpose |
|---|---|---|
ASR_CONFIG |
model_id, language, device |
Whisper model and Tamil (ta) transcription |
BUFFER_CONFIG |
max_queue_size, chunk_duration, sample_rate |
Long-audio chunking and batch size |
TRANSLITERATION_CONFIG |
src_script, tgt_script |
Romanization scheme labels |
APP_CONFIG |
host, port, share, output paths |
Gradio bind address and folders |
Common tweaks:
# Use GPU when available
ASR_CONFIG["device"] = "cuda"
# Smaller/faster model (less accurate)
ASR_CONFIG["model_id"] = "openai/whisper-small"
# Public Gradio link (temporary share URL)
APP_CONFIG["share"] = TrueEquivalent environment variables (no code edit needed):
| Variable | Default | Purpose |
|---|---|---|
WHISPER_MODEL_ID |
openai/whisper-medium |
ASR model |
ASR_LANGUAGE |
ta |
Transcription language |
ASR_DEVICE |
cpu |
cuda for GPU |
GRADIO_SERVER_NAME / GRADIO_SERVER_PORT |
0.0.0.0 / 7860 |
Bind address |
PORT |
— | Honored when GRADIO_SERVER_PORT is unset (Render/Railway) |
GRADIO_SHARE |
false |
Temporary public URL |
CHUNK_DURATION_SEC / BUFFER_MAX_QUEUE |
30 / 10 |
Long-audio chunking |
VoiceNote-AI/
├── app/
│ ├── main.py # Entry point
│ ├── interface.py # Gradio UI
│ ├── asr_pipeline.py # Whisper + chunked transcription
│ ├── transliteration.py # Romanization pipeline
│ ├── tamil_romanizer.py # Grapheme → ASCII mapping
│ ├── buffer_manager.py # Chunk queue for long audio
│ └── utils.py # Validation, splitting, file I/O
├── models/
│ └── model_config.py # Central config
├── sample_inputs/ # Example audio (e.g. sample.wav)
├── outputs/ # Generated files (gitignored)
│ ├── transcripts/
│ └── transliterations/
├── tests/
│ └── test_pipeline.py
├── Dockerfile
├── docker-compose.yml
├── packages.txt # apt deps for Hugging Face Spaces (ffmpeg)
└── requirements.txt
- Place a file at
sample_inputs/sample.wav(or update the path inapp/interface.py→gr.Examples). - In the UI, use Try with sample audio, then Transcribe & Transliterate.
Supported inputs depend on ffmpeg and Gradio’s audio widget (common formats: WAV, MP3, M4A, etc.).
Each successful run writes:
outputs/transcripts/transcript_YYYYMMDD_HHMMSS.txt— Tamil Unicode textoutputs/transliterations/transliteration_YYYYMMDD_HHMMSS.txt— ASCII romanization
The outputs/ directory is ignored by git so local runs are not committed.
source venv/bin/activate
pytest tests/test_pipeline.py -vCovers buffer queue behavior, transliteration (ASCII output), utilities, and directory setup.
| Issue | What to try |
|---|---|
ffmpeg not found |
Install: brew install ffmpeg (macOS), apt install ffmpeg (Debian/Ubuntu) |
HfFolder / huggingface-hub errors |
Use requirements.txt as pinned (huggingface-hub<1.0) |
Gradio schema / TypeError on launch |
Keep Gradio 4.44.x and pinned FastAPI/Starlette/Pydantic from requirements.txt |
| Broken venv / wrong Python | Delete venv/, recreate, reinstall requirements |
| Empty or corrupt audio | Re-export as WAV; check file size > 0 |
| Very slow on CPU | Expect long runs on medium; try whisper-small in config or enable CUDA |
| Port 7860 in use | Change APP_CONFIG["port"] or stop the other process |
| Docker healthcheck failing | Wait for first model download; check logs with docker compose logs -f |
This repo mirrors the Task 2 ASR + transliteration flow from the indic-translation-asr internship project: Whisper for Tamil ASR and an in-house romanizer instead of an external transliteration API.
See repository defaults; add a LICENSE file if you publish formally.