augaudio
This package contains multiple simple audio data augmentations in order to increase/test the robustness of neural networks.
Original
Gaussian Noise
Pitch Shift
Time Stretch
Crush
Installation
You can install this package via
pip install augaudio
Usage
Example usage:
import librosa
import augaudio
import soundfile
y, sr = librosa.load('audio.wav')
augmented = augaudio.augment(y, 1, 4)
soundfile.write('augmented.wav', augmented, sr)
Directly access one of the augmentations:
...
augmented = augaudio.GaussianNoise(y, 4)
...
Chain augmentations together:
...
augmented = augaudio.GaussianNoise(augaudio.TimeStretch(y, 2), 4)
...
Iterate over augmentations:
...
for augmentation in range(4):
for intensity in range(1,10):
augmented = augaudio.augment(y, augmentation, intensity)
soundfile.write(str(augmentation) + '-' + str(intensity) + '.wav', augmented, sr)
...
Command Line Usage:
Single File:
augaudio /path/to/audio.wav 0 5
Complete Folder:
augaudio /path/to/input 0 5 /path/to/output
Augmentations
| Augmentation | index | Description | negative intensity |
|---|---|---|---|
| Augmentations | -2 | Applies /multiple/ random augmentations | available |
| Random | -1 | Applies random augmentation | available |
| GaussianNoise | 0 | Applies gaussian noise to the audio data | n/a |
| PitchShift | 1 | Shifts the pitch of the audio data | available |
| TimeStretch | 2 | Stretches the time of the audio data | n/a |
| Crush | 3 | Crushes details by applying and reversing a pitch shift | available |
Copyright Notice
Copyright 2020 Bastian Schwickert
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Metadata
Release files for augaudio 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| augaudio-1.0.4.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| augaudio-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.0 kB
Release files / augaudio-1.0.4.tar.gz
| Download URL | augaudio-1.0.4.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ac3085c4a96a371461ad8d870a57872c651a5928e38ae66335c82bb360b7c23
|
|
BLAKE2b-256 checksum How to use checksums |
31ad998ec4cff4a25a6944c7dfaca713ec23b7cd2ea632407e96f0450cf88dd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.3
|
Release files / augaudio-1.0.4-py3-none-any.whl
| Download URL | augaudio-1.0.4-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35484fd0c26b2a7c716b0d30370b8651934b8f687729cc33524247c003b58c8e
|
|
BLAKE2b-256 checksum How to use checksums |
19f2bb36fe3dd7c6bece0a84cf3e61a65019c2904bac225e8aeff72978cf0d1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.3
|