--- id: audiomentations version: "0.43.1" license: MIT license_treatment: permissive maintenance: active --- # audiomentations — A Python library for audio data augmentation. Inspired by albumentations. Useful for machine learning. License: permissive · Maintenance: active · Downloads: 211.3K/mo ## 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 above — 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 pip install audiomentations uv add audiomentations 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_current - Install friction: low - Maintenance: active - Downloads: 211.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags audio data augmentation, audio transformations for machine learning, random audio perturbations, audio preprocessing pipeline, training data augmentation audio, real-time audio effects, audio signal augmentation, audio-ml, data-augmentation, signal-processing [View on SkillFed](https://skillfed.io/packages/audiomentations) · [View on PyPI](https://pypi.org/project/audiomentations/)