Skip to main content

Augments audio for machine learning

Project description

AudAugio (pronounced like “adagio”) is a Python library for augmenting audio for machine learning. It includes a built-in set of common augmentations as well as the ability to easily define new ones, as well as a framework for applying and layering those augmentations.

Installation

Install AudAugio with pip:

pip install audaugio

If you want to use one of the built-in augmentations that relies on SoX, you’ll need to install it separately. You can do that at the SoX SourceForge page. Augmentations that rely on SoX note that in their documentation, and are listed here:

  • Equalizer Augmentation

  • Low Pass Augmentation

  • High Pass Augmentation

Use

Below is an example of how to use AudAugio to augment an audio file:

import librosa

import audaugio

y, sr = librosa.load('sample.wav')

chain = audaugio.CombinatoricChain(audaugio.PitchShiftAugmentation(1),
                                   audaugio.BackgroundNoiseAugmentation(.005),
                                   audaugio.EqualizerAugmentation(800, .15, -15))

augmented_audio = chain(y, sr)

for i, a in enumerate(augmented_audio):
    librosa.output.write_wav("output/{0}.wav".format(i), a, sr)

For more, read the documentation for AudAugio.

Augmentation Chains

Augmentations are applied through augmentation chains. There are two kinds of chains - combinatoric chains and linear chains. Combinatorically applying the augmentations creates a modified and unmodified version of the signal for each augmentation, which are then each augmented further by the remaining augmentations in the chain. For example, if a single signal is combinatorically augmented with both a pitch shift augmentation and a background noise augmentation, there will be four resulting augmented signals:

  • The dry signal

  • The pitch shifted signal

  • The signal with background noise added

  • The pitch shifted signal with background noise added

Linear chains do not retain the unmodified signal after processing. If same chain as above was applied, the only signal returned would be the pitch shifted signal with background noise added.

Contact

Contact Brian Margolis (brianmargolis [at] u.northwestern.edu) with any questions or issues. Please look at the “issues” page before reporting problems.

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

AudAugio-0.0.2a0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

AudAugio-0.0.2a0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file AudAugio-0.0.2a0.tar.gz.

File metadata

  • Download URL: AudAugio-0.0.2a0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3

File hashes

Hashes for AudAugio-0.0.2a0.tar.gz
Algorithm Hash digest
SHA256 b25cebbbc419b1c5901e63c5b9e6f24790fa577ae17301073a68c5ed48a1807e
MD5 3d261fab6af7eeb79a18d65f4d7cd019
BLAKE2b-256 2845cab43b048ce857065d82834325a403d5123279f9039dda18be9f4913bd1b

See more details on using hashes here.

File details

Details for the file AudAugio-0.0.2a0-py3-none-any.whl.

File metadata

  • Download URL: AudAugio-0.0.2a0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3

File hashes

Hashes for AudAugio-0.0.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0034e0c2c7d90b750021e0016f95187829894d66adc24fb1e2c80976d928805
MD5 3abc37ae8f7865999d3867ce1e7a2a7d
BLAKE2b-256 4702723f9920d00ed08e192bed8cdcf6cd2b2c8c728d45fc8b137de66ef0f330

See more details on using hashes here.

Supported by

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