Skip to main content

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

Project description

Audiomentations

Build status Code coverage Code Style: Black Licence: MIT

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

Setup

Python version support PyPI version Number of downloads from PyPI per month

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


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.10.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audiomentations-0.10.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file audiomentations-0.10.0.tar.gz.

File metadata

  • Download URL: audiomentations-0.10.0.tar.gz
  • Upload date:
  • Size: 9.7 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

Hashes for audiomentations-0.10.0.tar.gz
Algorithm Hash digest
SHA256 6c805d6ac1c3fee05db31931f61402358f695647939479e835d86de70beb06f7
MD5 c271c3cd2c968130d8a05e0c88a8d499
BLAKE2b-256 62b8fabe5379156989531c7925e1d2749cc567341168f827a0410a0f24c4bd42

See more details on using hashes here.

File details

Details for the file audiomentations-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: audiomentations-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 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

Hashes for audiomentations-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0accc43bf6a2fec28c76e02b8301821c54b407e73b5bc6a08d2326c6d9d230d2
MD5 7ff926a0c486a33119eca6966998876d
BLAKE2b-256 e7087f2f1897bcc5f848ebd7761a3ce46064bc255256ca51df50d0e4ab225bbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page