Skip to main content

A library for audio data augmentation. Inspired by albumentations.

Project description

Audiomentations

Build status Code coverage

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

Setup

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)

Development

Code style

Format the code with black

Run tests and measure code coverage

pytest

Generate demo sounds for empirical evaluation

python -m demo.demo

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.6.0.tar.gz (3.3 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.6.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: audiomentations-0.6.0.tar.gz
  • Upload date:
  • Size: 3.3 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.6.0.tar.gz
Algorithm Hash digest
SHA256 da084597f438e0dad467f70b7550d9e0e1f447276aa1306b492df46f52e6d8e4
MD5 c0e410d19d22223e9ceb93fda84b25e1
BLAKE2b-256 a687dd4221efcb0c6f8fd8ae6d330f3974b8b3bcd2f164958b61e56862b1cbdd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: audiomentations-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67a806249eeec65c9beb9a96c151e524b876c7a231d3f636925c1ad18e43fa6a
MD5 019fa682c51c7c4782e3f5dce74e5fe7
BLAKE2b-256 b689657abb02048a6402d9ac0704f24bdc6d6a06d5b001d7a71292c21041c92d

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