skillfed

audiomentations

A Python library for audio data augmentation. Inspired by albumentations. Useful for machine learning.

audiomentations v0.43.1 211.3K downloads/30d#9,481 on PyPI2,310
Permissive license MIT Active released

What it is and what it does

Audiomentations is a Python library for augmenting audio data by applying randomized transformations to waveforms. It provides a Compose-based API inspired by albumentations, letting you chain transforms like noise injection, pitch shifting, time stretching, filtering, and distortion with configurable probability. The library runs on CPU, supports both mono and multichannel audio, and integrates directly into training loops for TensorFlow/Keras and PyTorch.

The package solves the problem of generating synthetic audio variations during training to improve model robustness and generalization. Rather than manually coding audio effects, you declare a pipeline of transforms with parameter ranges, and the library applies them randomly to each sample during training. It is designed for practitioners building real-world audio ML systems—speech recognition, audio classification, sound event detection—where models trained only on clean lab data often fail in production.

Use it for:

  • Augment speech data during training to improve robustness to background noise and acoustic variation.
  • Generate synthetic pitch and tempo variations to train music information retrieval models.
  • Simulate room acoustics and microphone artifacts to make audio classifiers generalize across recording conditions.
  • Add realistic distortion and compression artifacts to train models that handle low-quality or compressed audio.
  • Combine multiple transforms in a pipeline to create diverse training samples from a small audio dataset.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Audiomentations applies randomized audio transformations—noise injection, pitch shifting, time stretching, filtering, and distortion—to augment training data for machine learning models that work with audio.

Yes. Audiomentations is actively maintained, has no security vulnerabilities, installs with low friction, and provides a well-documented, production-ready API for audio augmentation. It is particularly valuable if you are training audio ML models and need to generate synthetic variations without writing custom signal processing code. The MIT license removes legal barriers. Install it if audio data augmentation is part of your training pipeline.

Install

audiomentations on PyPI

pip

pip install audiomentations

uv

uv add audiomentations

poetry

poetry add audiomentations

Installing audiomentations

Before you install

Low friction: pure Python wheel with no compiled dependencies beyond numpy and scipy. Actively maintained with a recent release (335 days ago) and 2310 repository stars. Supports Python 3.10–3.13.

License in practice

MIT license permits unrestricted commercial and private use, modification, and distribution with minimal legal friction.

Quickstart

pip install audiomentations

from audiomentations import Compose, AddGaussianNoise, TimeStretch, PitchShift
import numpy as np

augment = Compose([
    AddGaussianNoise(min_amplitude=0.001, max_amplitude=0.015, p=0.5),
    TimeStretch(min_rate=0.8, max_rate=1.25, p=0.5),
    PitchShift(min_semitones=-4, max_semitones=4, p=0.5),
])

samples = np.random.uniform(low=-0.2, high=0.2, size=(32000,)).astype(np.float32)
augmented = augment(samples=samples, sample_rate=16000)

Verify before relying

  • Whether all 7 runtime dependencies (numpy-minmax, numpy-rms, python-stretch, soxr) are required for core functionality or only for specific transforms.
  • Performance characteristics and typical augmentation speed on CPU for real-time training pipelines.
  • Multichannel audio support details and any channel-count constraints.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 7 — numpy, numpy-minmax, numpy-rms, librosa, python-stretch, scipy, soxr
Maintenance actively maintained — 335 days since the last release
Last repo commit
First released
Downloads 211,335/month — #9,481 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: audiomentations-0.43.1-py3-none-any.whl

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: MultimediaTopic :: Multimedia :: Sound/AudioTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial Intelligence

Tags

audio data augmentationaudio transformations for machine learningrandom audio perturbationsaudio preprocessing pipelinetraining data augmentation audioreal-time audio effectsaudio signal augmentation
audio-mldata-augmentationsignal-processing

More Scientific/Engineering packages

Further reading