Skip to main content

🎛️ Wav2Aug: Toward Universal Time-Domain Speech Augmentation

A minimalistic PyTorch-based audio augmentation library for speech and audio augmentation. The goal of this library is to provide a general purpose speech augmentation policy that can be used on any task and perform well without having to tune augmentation hyperparameters. Just install, and start augmenting. Applies two random augmentations per call.

Diagram

⚙️ Features

  • 9 core augmentations: amplitude scaling/clipping, noise addition, frequency dropout, polarity inversion, chunk swapping, speed perturbation, time dropout, and babble noise.
  • Simplicity: just install and start augmenting!
  • Randomness: all stochastic ops use PyTorch RNGs. Set a single seed and be done, e.g. torch.manual_seed(0); torch.cuda.manual_seed_all(0)

📦 Installation

pip

pip install wav2aug

uv

uv add wav2aug

🚀 Quick Start

import torch
from wav2aug.gpu import Wav2Aug

# Initialize the augmenter once
augmenter = Wav2Aug(sample_rate=16000)

# in the forward pass
wavs = torch.randn(3, 50000)
lens = torch.ones((wavs.size(0)))

aug_wavs, aug_lens = augmenter(wavs, lens)

That's it!

🧪 Augmentation Types

  • 🔊 Amplitude Scaling/Clipping: Random gain and peak limiting
  • 🌫️ Noise Addition: Environmental noise with SNR control
  • 📶 Frequency Dropout: Spectral masking with random notch filters
  • 🔄 Polarity Inversion: Random phase flip
  • 🧩 Chunk Swapping: Temporal segment reordering
  • ⏱️ Speed Perturbation: Time-scale modification
  • 🕳️ Time Dropout: Random silence insertion
  • 👥 Babble Noise: Multi-speaker background (auto-enabled with sufficient buffer)

🛠️ Development Installation

uv

git clone https://github.com/gfdb/wav2aug
cd wav2aug

# create venv and pin Python
uv venv
source .venv/bin/activate
uv python pin 3.10  # or 3.11/3.12

# runtime only
uv sync

# extras
uv sync --extra dev
uv sync --extra test

pip

git clone https://github.com/gfdb/wav2aug
cd wav2aug

# create venv
python -m venv .venv
source .venv/bin/activate

# runtime only
python -m pip install .

# editable + extras for development
python -m pip install -e '.[dev,test]'

✅ Tests

uv

uv run pytest -q tests/

pip

pytest -q tests/

🤝 Contributing

  • Issues and PRs are welcome and encouraged!

  • Bug reports: please open an issue with a minimal repro (env, torch/torchaudio/torchcodec versions, code snippet, expected vs. actual, traceback).

  • Feature requests: please open an issue with use-case and proposed feature.

  • PRs: keep them focused. Add tests when behavior changes. Don't forget to run formatters and tests before submitting!

Metadata

Release files for wav2aug 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wav2aug 0.0.4
File Size Uploaded
wav2aug-0.0.4.tar.gz 24.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wav2aug 0.0.4
File Interpreter ABI Platform
wav2aug-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 50.7 kB

Release files / wav2aug-0.0.4.tar.gz

Download URL wav2aug-0.0.4.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0b9f8514abb2a002b5035b4383d65c85b5ff3a3c0014e31af764a7a4e4d0cc7d
BLAKE2b-256 checksum
How to use checksums
978cf634206d4f72f222d9a5302cc646d2a4555703cb8bc47a54600d64a31e7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / wav2aug-0.0.4-py3-none-any.whl

Download URL wav2aug-0.0.4-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25049fe647e7c609a82fc003f85f158540482299507d65c11558f7978747efd9
BLAKE2b-256 checksum
How to use checksums
f5e88e035f91cfca980c646486c6a23307bacdc4d38ed905debfb15ca3191ba4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page