A library for audio data augmentation. Inspired by albumentations.
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)
Development
Code style
Format the code with black
Run tests
nosetests
Generate demo sounds for empirical evaluation
python -m demo.demo
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.5.0.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file audiomentations-0.5.0.tar.gz
.
File metadata
- Download URL: audiomentations-0.5.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92dc2c3bcd102b129ec4571bac3229221c0ce9c6418f8c9d24a50f7ef11e5f7b |
|
MD5 | 661ce260ea6bb9fbcd2e5c00622716aa |
|
BLAKE2b-256 | ce496e8131a34a3d07e99be3be390ac6961696511ced19fe1b4b4da7dc93cbce |
File details
Details for the file audiomentations-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: audiomentations-0.5.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24508b21bee536ec74d78998636e67eb11103fab1936cab18a2fa05f7fcd3e00 |
|
MD5 | 2836a65e8e02af1946aeffdb9d8309a5 |
|
BLAKE2b-256 | 37d7886df58f8573cc060bf3eca481c611e9f52743b95042c8b9fcdde31e5d21 |