A Python library for audio data augmentation. Inspired by albumentations. Useful for machine learning.
Project description
Audiomentations
A Python library for audio data augmentation. Inspired by albumentations. Useful for machine learning.
Setup
pip install audiomentations
Usage example
from audiomentations import Compose, AddGaussianNoise, TimeStretch, PitchShift, Shift
import numpy as np
SAMPLE_RATE = 16000
augmenter = 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),
Shift(min_fraction=-0.5, max_fraction=0.5, p=0.5),
])
samples = np.zeros((20,), dtype=np.float32)
samples = augmenter(samples=samples, sample_rate=SAMPLE_RATE)
Go to audiomentations/augmentations/transforms.py to see which transforms you can apply.
Development
Install the dependencies specified in requirements.txt
Code style
Format the code with black
Run tests and measure code coverage
pytest
Generate demo sounds for empirical evaluation
python -m demo.demo
Alternatives
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
audiomentations-0.8.0.tar.gz
(5.9 kB
view details)
Built Distribution
File details
Details for the file audiomentations-0.8.0.tar.gz
.
File metadata
- Download URL: audiomentations-0.8.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06520ea675506731572b821895259cdcbb2189250782803842801dd5acdd0c22 |
|
MD5 | 9ec08ec50dad25bd4fadac477c1a9e12 |
|
BLAKE2b-256 | d9cd284c5162941e00d82cde90381af5321e8c683b1b89aa3bb15a3b8103ab1c |
File details
Details for the file audiomentations-0.8.0-py3-none-any.whl
.
File metadata
- Download URL: audiomentations-0.8.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeea5206d7466a9bbb76770b9449f23b8d18a989a296be93f25eef9b53568b4d |
|
MD5 | f92e64b84b0b147542e02cd093ad5902 |
|
BLAKE2b-256 | 441752b98b998a5425e91ea626c4304115772ac999815057a11129eb888e2383 |