Skip to content

Latest commit

Β 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VoxPolish β€” TTS Dataset Cleaner

VoxPolish

A TTS Dataset Cleaner β€” turn noisy audio into clean, training-ready datasets in one command.

TTS dataset cleaner Β· audio dataset cleaner Β· speech denoising Β· noise removal Β· silence trimming Β· loudness normalization for text-to-speech training

Python 3.8+ License: MIT Neural Denoising GPU + CPU Try it live

πŸ‘‰ Try VoxPolish live in your browser β€” upload audio, hear it cleaned instantly. No install.

Bad audio = bad TTS models. This tool removes background noise, trims silence, and normalizes loudness across your entire dataset β€” so your TTS model trains on clean, consistent speech.

Quick Start Β· Usage Β· How It Works Β· Benchmarks Β· FAQ


πŸ’‘ Why this exists

VoxPolish is an open-source TTS dataset cleaner. Training a good text-to-speech (TTS) model needs clean audio. Real-world recordings have background hum, fan noise, room echo, inconsistent volume, and dead air at the start and end of clips. Cleaning a dataset by hand is impossible at scale.

TTS Dataset Cleaner runs your whole dataset through a 3-stage pipeline automatically:

Stage What it does Why TTS needs it
πŸ”‡ Noise Removal Neural deep-learning denoiser Clean speech = clean voice clones
βœ‚οΈ Silence Trimming Cuts dead air from start & end No awkward pauses in generated speech
πŸ“Š Loudness Norm Normalizes every file to -23 LUFS Consistent volume = stable training

Point it at a folder. Get back a clean dataset. That's it.


🎧 See & Hear the Difference

The waveforms show the constant noise floor removed and dead air trimmed β€” speech stays, everything else goes.

🎧 Want to actually hear it? ▢️ Try VoxPolish live β€” upload any clip and hear it cleaned with a real audio player. Or tap the Before/After links below to play the demo clips.

πŸ—£οΈ Voice Recording

Voice before and after

πŸ”΄ Before β€” noisy Β β†’Β  🟒 After β€” cleaned

πŸš— Background / Traffic Noise

Background noise before and after

πŸ”΄ Before β€” noisy Β β†’Β  🟒 After β€” cleaned

Every "after" clip is denoised, silence-trimmed, and normalized to -23 LUFS. Clips are MP3 β€” they play in your browser when opened.


✨ Features

  • πŸš€ One command β€” python clean.py --input ./data --output ./clean
  • 🧠 Neural denoising β€” state-of-the-art noise suppression, phase-aware (no robotic artifacts)
  • 🎯 Auto-detects dataset format β€” LJSpeech, VCTK, or a plain folder of audio
  • πŸ“ Preserves structure β€” keeps your metadata.csv, subfolders, and filenames intact
  • πŸ–₯️ GPU or CPU β€” runs anywhere; uses your GPU automatically if available
  • 🌐 Web UI included β€” drag-and-drop a ZIP, download cleaned dataset
  • πŸ“‹ Detailed reports β€” per-file stats, latency, failures
  • πŸŽ›οΈ Fully configurable β€” toggle any stage, tune loudness target & noise limits

πŸš€ Quick Start

git clone https://github.com/Jeevav62/voxpolish.git
cd voxpolish

Then pick the path that suits you:

🐳 Option A β€” Docker (zero setup)

Runs the web UI in a container β€” no Python, no dependencies to install.

docker compose up --build
# open http://localhost:7860

Or clean a dataset headlessly via the CLI in the container:

docker compose run --rm voxpolish python clean.py --input /data/in --output /data/out
# put your dataset in ./data/in β€” cleaned files appear in ./data/out

⚑ Option B β€” one-command script

Creates a venv, auto-installs GPU or CPU PyTorch, and all dependencies.

bash setup.sh        # sets everything up
bash run.sh          # launches the web UI

πŸ”§ Option C β€” manual setup

2. Create a virtual environment

python -m venv venv

# Windows
venv\Scripts\activate

# Linux / macOS
source venv/bin/activate

3. Install PyTorch

GPU (NVIDIA β€” recommended, much faster):

pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu121

CPU only (works everywhere, slower):

pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu

Not sure which CUDA version you have? Run nvidia-smi. CUDA 12.x β†’ use cu121. CUDA 11.x β†’ use cu118.

4. Install the rest

pip install -r requirements.txt

5. Verify GPU (optional)

python -c "import torch; print('GPU:', torch.cuda.is_available())"

πŸ“– Usage

Command Line

Basic β€” clean a folder:

python clean.py --input ./my_dataset --output ./my_dataset_clean

LJSpeech dataset (keeps metadata.csv):

python clean.py --input ./LJSpeech-1.1 --output ./LJSpeech-clean

Tune the pipeline:

python clean.py \
  --input ./data \
  --output ./clean \
  --target-lufs -20 \      # louder output
  --atten-lim 15 \         # gentler noise removal (preserve more)
  --no-trim                # skip silence trimming

All options:

Flag Default Description
--input (required) Input folder (audio files or dataset)
--output (required) Output folder (created automatically)
--no-pf off Disable post-filter (faster, slightly less suppression)
--atten-lim none Limit noise reduction to N dB (preserves naturalness)
--no-trim off Skip silence trimming
--no-norm off Skip loudness normalization
--target-lufs -23.0 Loudness target (EBU R128 standard)
--workers 1 Parallel workers (keep at 1 for GPU)

After running, check output/cleaning_report.txt for a full summary.

Web UI (Gradio)

python app.py

Opens at http://127.0.0.1:7860. ZIP your dataset, drag it in, tweak the options, download the cleaned ZIP. Live progress bar and stats included.


πŸ”¬ How It Works

  Your noisy audio (any format, any sample rate)
                    β”‚
                    β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  1. Load & resample    β”‚   β†’  48kHz (denoiser's native rate)
        β”‚     to 48kHz           β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  2. Neural denoise     β”‚   β†’  AI removes noise, keeps speech
        β”‚     noise removal      β”‚      (complex spectral filtering)
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  3. Resample back      β”‚   β†’  your original sample rate
        β”‚     to original SR     β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  4. Trim silence       β”‚   β†’  cut dead air, start & end
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  5. Loudness normalize β”‚   β†’  every file at -23 LUFS
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β–Ό
       Clean, consistent, training-ready audio βœ…

The denoiser: the noise-removal core is a two-stage neural network. Stage 1 uses a lightweight GRU on perceptual ERB frequency bands for coarse noise removal. Stage 2 applies fine-grained complex filters only where speech lives. Because it processes both magnitude and phase, the output sounds natural β€” not the metallic, robotic artifacts older denoisers produce.


πŸ“ Supported Formats

Input audio: .wav .mp3 .flac .ogg .m4a .aac

Dataset layouts (auto-detected):

Type Structure Handling
LJSpeech wavs/ + metadata.csv Cleans wavs/, copies metadata unchanged
VCTK speaker_id/wav48/*.wav Cleans per-speaker, preserves structure
Raw folder any nested folders of audio Cleans everything, mirrors folder tree

Output preserves your original sample rate, filenames, and folder structure.


πŸ“Š Benchmarks

Tested on NVIDIA RTX 2050 (4GB) Β· CUDA 12.9 Β· 16kHz speech clips:

Metric Value
Avg processing time ~276 ms/file
Real-time factor ~0.05x (β‰ˆ18Γ— faster than real-time)
VRAM used ~74 MB
Output loudness accuracy Β±0.1 LUFS of target

A 10,000-file dataset cleans in roughly 45 minutes on GPU. CPU works too β€” slower, but no GPU required.


❓ FAQ

Do I need a GPU?
No. It runs on CPU just fine β€” just slower. A GPU (even a modest one) gives ~10-20Γ— speedup for large datasets.
I get a cudnnException warning. Is something broken?
No. It's a harmless cuDNN fallback message on some GPUs. The model automatically uses a different code path and results are identical. It's suppressed by default.
Will it change my sample rate?
No. Audio is internally processed at 48kHz (the model's requirement) but saved back at your original sample rate.
Does it work on music or non-speech?
It's tuned for speech. It will run on anything, but quality is optimized for voice β€” perfect for TTS, not for music mastering.
My output is too quiet / too loud.
Adjust --target-lufs. -23 is the broadcast standard. For louder output try -18 or -16. For audiobook style try -20.
The denoiser removed too much / made speech sound thin.
Use --atten-lim 12 (or higher). This caps how much noise is removed, blending in some of the original to preserve naturalness.

🀝 Contributing

Contributions welcome! Ideas:

  • Additional dataset formats (Common Voice, custom layouts)
  • Voice activity detection (VAD) to drop non-speech clips
  • Per-file quality scoring (SNR, MOS estimation)
  • Batch GPU inference for higher throughput

Open an issue or PR.


πŸ™‹ Work With Me

I'm Jeeva β€” I turn research papers into shipping products: reading the latest work and rebuilding it into real features, tools, and ideas people can use. VoxPolish is one example β€” a research-grade speech model wrapped into a one-command product.

What I do:

  • πŸ”¬ Research β†’ product β€” take papers/models and ship them as usable features
  • πŸ—£οΈ Fine-tune TTS & LLMs β€” voice cloning, custom speech models, domain-tuned language models
  • πŸ› οΈ Practical ML & audio tooling β€” pipelines, datasets, and apps that actually run

I'm open to collaboration, open-source work, and hiring opportunities. If you need someone who reads the paper and ships the product, let's talk:


πŸ“œ License

MIT β€” see LICENSE. Free for commercial and personal use.


πŸ™ Credits

Denoising powered by DeepFilterNet (MIT) Β· loudness normalization via pyloudnorm.

If this saved you time, drop a ⭐ β€” it helps others find it.

About

VoxPolish - a TTS dataset cleaner. Remove noise, trim silence, normalize loudness for text-to-speech training data in one command.

Topics

Resources

Contributing

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages