Upload an audio file, detect profanity with AssemblyAI, and download the same recording with every bad word replaced by a beep.
Inspired by the AssemblyAI profanity-filter-demo.
- Upload audio - MP3, WAV, M4A, OGG, FLAC, and more
- Automatic profanity detection - powered by AssemblyAI
filter_profanity - Beep censorship - profane segments are replaced with a tone at the exact timestamps
- Transcript & report - view censored transcript and flagged words with timestamps
- Custom word lists - add blocked or allowed words in the sidebar
- Download - export the moderated MP3
Audio upload - AssemblyAI transcription (profanity filter on)
- Find censored words (e.g. f***)
- Splice beeps at word timestamps (pydub + FFmpeg)
= Return moderated audio + transcript + flags
- You upload an audio file.
- The backend uploads it to AssemblyAI and transcribes with
filter_profanity: true. - Profane words appear in the transcript as censored text (e.g.
f***). - The backend locates those words by timestamp and overlays a beep on each segment.
- You play or download the moderated file and review the flagged-word list.
| Layer | Stack |
|---|---|
| Frontend | React, Vite, Lucide icons |
| Backend | Python, FastAPI, pydub |
| AI | AssemblyAI (Universal-3 Pro / Universal-2) |
| Audio | FFmpeg |
- Python 3.10+
- Node.js 18+
- FFmpeg - install guide
- AssemblyAI API key - free signup
git clone https://github.com/sudo-pixel-spec/Audio-Profanity-Moderator.git
cd Audio-Profanity-Moderator
cp .env.example .envEdit .env and add your key:
ASSEMBLYAI_API_KEY=your_keycd backend && python -m venv .venv && .venv/bin/pip install -r requirements.txt
cd ../frontend && npm installTerminal 1 - backend (http://127.0.0.1:8000):
./start-backend.shTerminal 2 - frontend (http://localhost:5173):
./start-frontend.shOpen the frontend URL, drop an audio file, and wait for processing to finish.
The backend loads
.envfrom the project root automatically.
├── .env.example
├── start-backend.sh
├── start-frontend.sh
├── backend/
│ ├── main.py # FastAPI routes
│ └── services/
│ ├── assemblyai.py # Upload + transcribe
│ └── censor.py # Beep profanity segments
└── frontend/
└── src/
└── AudioModerator.jsx # Main UI
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Health check + API key status |
POST |
/api/moderate |
Upload audio; returns transcript, flags, audio URL |
GET |
/api/moderate/{job_id}/audio |
Download moderated MP3 |
curl -X POST http://127.0.0.1:8000/api/moderate \
-F "file=@sample.mp3" \
-F "language=English" \
-F "bleep_audio=true" \
-F 'blocked_words=[]' \
-F 'allowed_words=[]'| Setting | Description |
|---|---|
| Language | Transcription language (English, Spanish, etc.) |
| Auto-bleep audio | Replace profanity with beeps (off = transcript only) |
| Blocked words | Extra words to flag and beep |
| Allowed words | Words to skip even if detected |
| Issue | Fix |
|---|---|
speech_models must be a non-empty list |
Pull latest code - AssemblyAI requires speech_models on every request |
ASSEMBLYAI_API_KEY not set |
Create .env in project root with your key |
| Audio export fails | Install FFmpeg and ensure it is on your PATH |